This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This allows to use global variables inside the FastAPI application using async mode. | |
# Usage | |
Just import `g` and then access (set/get) attributes of it: | |
```python | |
from your_project.globals import g | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding=utf-8 | |
# Project: learn-pytorch | |
# Author: xingjunjie github: @gavinxing | |
# Create Time: 29/07/2017 11:58 AM on PyCharm | |
# Basic template from http://pytorch.org/tutorials/beginner/nlp/word_embeddings_tutorial.html | |
import torch | |
import torch.nn as nn | |
import torch.autograd as autograd | |
import torch.optim as optim |