Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
import torch | |
import time | |
def timeit(): | |
torch.cuda.synchronize() | |
start = time.time() | |
x = torch.cuda.FloatTensor(10000,10000) | |
torch.cuda.synchronize() | |
print(time.time() - start) | |
return x |
This file contains hidden or 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
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torch.autograd import Variable | |
import numpy as np |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
From 784c05a1ca663d88d68a644108ad2514b79310dc Mon Sep 17 00:00:00 2001 | |
From: adityaarun1 <[email protected]> | |
Date: Wed, 16 Jan 2019 22:15:26 +0530 | |
Subject: [PATCH] migrating to Pytorch-1.0 | |
--- | |
.gitignore | 2 + | |
README.md | 13 +- | |
lib/make.sh | 56 +- | |
lib/model/csrc/ROIAlign.h | 46 + |
This file contains hidden or 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 file contains Transformer network | |
# Most of the code is copied from http://nlp.seas.harvard.edu/2018/04/03/attention.html | |
# The cfg name correspondance: | |
# N=num_layers | |
# d_model=input_encoding_size | |
# d_ff=rnn_size | |
# h is always 8 | |
from __future__ import absolute_import |
This file contains hidden or 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
import torch | |
import torch.multiprocessing as mp | |
import torch.distributed as dist | |
from torchvision import transforms | |
import random | |
from functools import partial | |
from easydict import EasyDict as edict | |
from albumentations import ( | |
Compose, HorizontalFlip, ShiftScaleRotate, PadIfNeeded, RandomCrop, | |
RGBShift, RandomBrightness, RandomContrast |
This file contains hidden or 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
import torch | |
import torch.multiprocessing as mp | |
import torch.distributed as dist | |
from torchvision import transforms | |
import random | |
from functools import partial | |
from easydict import EasyDict as edict | |
from albumentations import ( | |
Compose, HorizontalFlip, ShiftScaleRotate, PadIfNeeded, RandomCrop, | |
RGBShift, RandomBrightness, RandomContrast |
This file contains hidden or 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
import torch | |
import torch.multiprocessing as mp | |
import torch.distributed as dist | |
from torchvision import transforms | |
import random | |
from functools import partial | |
from easydict import EasyDict as edict | |
from albumentations import ( | |
Compose, HorizontalFlip, ShiftScaleRotate, PadIfNeeded, RandomCrop, | |
RGBShift, RandomBrightness, RandomContrast |
This file contains hidden or 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
import os | |
import tempfile | |
import torch | |
import torch.distributed as dist | |
import torch.nn as nn | |
import torch.optim as optim | |
import torch.multiprocessing as mp | |
from torch.nn.parallel import DistributedDataParallel as DDP |
This file contains hidden or 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
import torch | |
import torch.nn as nn | |
class X(nn.Module): | |
def __init__(self): | |
super().__init__() | |
self.a = nn.Linear(3,4) | |
def forward(self, x): | |
x = next(self.parameters()) | |
import torchvision |
OlderNewer