version
stringclasses
24 values
code
stringlengths
396
135k
apis
list
full_version
stringlengths
1
6
repo_name
stringlengths
6
64
hexsha
stringlengths
40
40
1.4
""" Base loss definitions """ from collections import OrderedDict import copy import torch import torch.nn as nn from mixmo.utils import misc, logger LOGGER = logger.get_logger(__name__, level="DEBUG") class AbstractLoss(nn.modules.loss._Loss): """ Base loss class defining printing and logging utilies "...
[ "torch.nn.LogSoftmax", "torch.nn.modules.loss._Loss.__init__", "torch.stack", "torch.pow" ]
1.4.0
JiarunLiu/mixmo-pytorch
a9ad674122d9b6512094b8292280a4045bb5a400
1.4
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import math import warnings import torch import pyro import pyro.poutine as poutine from pyro.ops.stats import fit_generalized_pareto from .abstract_infer import TracePosterior from .enum import get_importance_trace class Impo...
[ "torch.cat", "torch.einsum", "torch.no_grad", "torch.logsumexp", "torch.tensor", "torch.exp", "torch.sort" ]
1.4.0
patrickeganfoley/pyro
3bd5e099e85f3686c66fc3b53476c3b009a77a02
1.4
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import torch from pyro.distributions import Categorical from pyro.distributions.torch_distribution import TorchDistributionMixin from pyro.ops.indexing import Vindex from pyro.util import ignore_jit_warnings from .messenger impor...
[ "torch.zeros", "torch.arange" ]
1.4.0
patrickeganfoley/pyro
3bd5e099e85f3686c66fc3b53476c3b009a77a02
1.0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 Nagoya University (Tomoki Hayashi) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """E2E-TTS training / decoding functions.""" import copy import json import logging import math import os import time import chainer import kaldiio import nu...
[ "torch.cat", "torch.cuda.is_available", "torch.LongTensor", "torch.FloatTensor", "torch.device", "torch.no_grad", "torch.from_numpy" ]
1.0.1
kokeshing/espnet
9e2bfc5cdecbb8846f5c6cb26d22010b06e98c40
1.10
import random from random import shuffle import PIL import torch import torch.nn.functional as F from torch.nn.utils import clip_grad_norm_ from torchvision.transforms import ToTensor from tqdm import tqdm from hw_asr.base import BaseTrainer from hw_asr.logger.utils import plot_spectrogram_to_buf from hw_asr.metric.u...
[ "torch.no_grad", "torch.cuda.empty_cache", "torch.nn.functional.log_softmax" ]
1.10.1
Mrrrat/asr_project_template
50d264684d90bc45c59f3e9be5766fabaf090d25
1.7
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2020-05-08 20:51 import functools import os from typing import Union, Any, List import torch from alnlp.modules.util import lengths_to_mask from torch import nn from torch.optim import Adam from torch.optim.lr_scheduler import ExponentialLR from torch.utils.data import D...
[ "torch.no_grad", "torch.optim.lr_scheduler.ExponentialLR" ]
1.7.1
emorynlp/levi-graph-amr-parser
f71f1056c13181b8db31d6136451fb8d57114819
1.8
import sys sys.path.append("..") import os import math import torch import torchvision import model.E.Ablation_Study.E_Blur_Z as BE from model.utils.custom_adam import LREQAdam import metric.pytorch_ssim as pytorch_ssim import lpips import numpy as np import tensorboardX import argparse from model.stylegan1.net import ...
[ "torch.device", "torch.cat", "torch.arange", "torch.ones", "torch.load", "torch.randn", "torch.where" ]
1.8
disanda/MSV
066ed236a4c5df8b4b5e366020fe2954b7a6915a
0.4
import os.path from data.base_dataset import BaseDataset, get_params, get_transform from data.image_folder import make_dataset from PIL import Image, ImageOps import torch class Aligned3TmMaxDataset(BaseDataset): """A dataset class for paired image dataset. It assumes that the directory '/path/to/data/train' ...
[ "torch.unsqueeze" ]
0.4.1
tkuri/pytorch-CycleGAN-and-pix2pix
b00b3f0bcebfb12d3f026c2a61c98ff63175a583
1.7
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
[ "torch.distributed.algorithms.model_averaging.averagers.PeriodicModelAverager", "torch.distributed.optim.PostLocalSGDOptimizer", "torch.distributed.broadcast_object_list", "torch.nn.parallel.distributed.DistributedDataParallel", "torch.distributed.get_backend", "torch.cuda.empty_cache", "torch.distribut...
1.7
alat-rights/pytorch-lightning
a4f1f3dc28982eb6578df62ca92b93f83a2defcc
1.5
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "torch.cat", "torch.no_grad", "torch.nn.CrossEntropyLoss", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.load", "torch.utils.tensorboard.SummaryWriter" ]
1.5.0
Emmyphung/flexible-input-slu
a2c7fff640b2b4aec830f3ca1b447c28dc506bb4
1.7
import cv2 import numpy as np import torch import torch.nn as nn from . import common from .agent import Agent from .controller import PIDController, CustomController from .controller import ls_circle STEPS = 5 SPEED_STEPS = 3 COMMANDS = 4 DT = 0.1 CROP_SIZE = 192 PIXELS_PER_METER = 5 def regression_base(): r...
[ "torch.cat", "torch.stack", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.no_grad", "torch.FloatTensor", "torch.nn.ReLU", "torch.nn.Conv2d" ]
1.7.1
jostl/masters-thesis
211e1f12a07428d37507e2bddc808f6da1149efb
1.7
import copy import math import time from pathlib import Path import random from kornia.filters import spatial_gradient from pytorch_msssim import ssim, SSIM import torch import torch.optim as optim from tensorboardX import SummaryWriter from torch.utils.data import DataLoader, random_split from tqdm import tqdm from ...
[ "torch.utils.data.random_split", "torch.set_grad_enabled", "torch.abs", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.mean" ]
1.7.1
jostl/masters-thesis
211e1f12a07428d37507e2bddc808f6da1149efb
0.4
""" IBN(b)-ResNet, implemented in PyTorch. Original paper: 'Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net,' https://arxiv.org/abs/1807.09441. """ __all__ = ['IBNbResNet', 'ibnb_resnet50', 'ibnb_resnet101', 'ibnb_resnet152'] import os import torch.nn as nn import torch.nn.init a...
[ "torch.nn.Linear", "torch.nn.init.kaiming_uniform_", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.init.constant_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.InstanceNorm2d", "torch.randn" ]
0.4.0
raijinspecial/imgclsmob
c87c0942420876941868c016211073dec4392e4d
0.4
""" PeleeNet, implemented in PyTorch. Original paper: 'Pelee: A Real-Time Object Detection System on Mobile Devices,' https://arxiv.org/abs/1804.06882. """ __all__ = ['PeleeNet', 'peleenet'] import os import torch import torch.nn as nn import torch.nn.init as init from .common import conv1x1_block, conv3x3_bl...
[ "torch.nn.Linear", "torch.cat", "torch.nn.Dropout", "torch.nn.init.kaiming_uniform_", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.init.constant_", "torch.randn" ]
0.4.0
raijinspecial/imgclsmob
c5d3ab207a6304f1343e4394f0467bdc7403a72a
1.1
import os import numpy as np import torch from torch.utils.data import Dataset from common.laserscan import LaserScan, SemLaserScan EXTENSIONS_SCAN = ['.bin'] EXTENSIONS_LABEL = ['.label'] def is_scan(filename): return any(filename.endswith(ext) for ext in EXTENSIONS_SCAN) def is_label(filename): return an...
[ "torch.from_numpy", "torch.full", "torch.tensor", "torch.utils.data.DataLoader" ]
1.1.0
andrewkouri/lidar-bonnetal
a0b5c6aba530701084ac66a02532689ed580f934
1.4
"""Test defintion common to CPU and CUDA""" import torch import torchaudio.functional as F from parameterized import parameterized from scipy import signal from torchaudio_unittest import common_utils class Lfilter(common_utils.TestBaseMixin): def test_simple(self): """ Create a very basic signal...
[ "torch.zeros", "torch.rand", "torch.ones", "torch.random.manual_seed", "torch.from_numpy", "torch.tensor" ]
1.4.0
prarabdh9909/audio
6bad3a66a7a1c7cc05755e9ee5931b7391d2b94c
1.0
""" This includes: LossComputeBase and the standard NMTLossCompute, and sharded loss compute stuff. """ from __future__ import division import torch import torch.nn as nn import torch.nn.functional as F import onmt from onmt.modules.sparse_losses import SparsemaxLoss from onmt.modules.sparse_activations...
[ "torch.nn.NLLLoss", "torch.autograd.backward", "torch.split", "torch.nn.functional.kl_div", "torch.full" ]
1.0
sajastu/abs-summarization
9d4b35b457cfd617965ed1fab68c173c98333439
1.0
import copy import unittest import math import torch import onmt import onmt.inputters import onmt.opts from onmt.model_builder import build_embeddings, \ build_encoder, build_decoder from onmt.encoders.image_encoder import ImageEncoder from onmt.encoders.audio_encoder import AudioEncoder from onmt.utils.parse im...
[ "torch.zeros", "torch.cat", "torch.ones" ]
1.0
sajastu/abs-summarization
9d4b35b457cfd617965ed1fab68c173c98333439
0.4
# System libs import os import argparse from distutils.version import LooseVersion from multiprocessing import Queue, Process # Numerical libs import numpy as np import math import torch import torch.nn as nn from scipy.io import loadmat # Our libs from mit_semseg.config import cfg from mit_semseg.dataset import ValDat...
[ "torch.nn.NLLLoss", "torch.zeros", "torch.max", "torch.no_grad", "torch.cuda.set_device", "torch.utils.data.DataLoader" ]
0.4.1
chenjun2hao/segmentation.pytorch
a319d0f006559dd58bd853065e6fe79ae8c23791
1.7
# Copyright (c) maiot GmbH 2020. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[ "torch.nn.Linear", "torch.round", "torch.nn.Dropout", "torch.sigmoid", "torch.save", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "torch.utils.data.DataLoader", "torch.nn.BCEWithLogitsLoss", "torch.utils.tensorboard.SummaryWriter" ]
1.7.0
ORG-MARS/zenml
8ee9a9264397d4e24a34c906e34a443782b189d3
0.4
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: speedinghzl02 ## Modified by: RainbowSecret ## Microsoft Research ## yuyua@microsoft.com ## Copyright (c) 2018 ## ## This source code is licensed under the MIT-style license found in the ## LICENSE file in the root directory of t...
[ "torch.utils.data.DataLoader" ]
0.4.1
liqile1/OCNet.pytorch
5fb733adbf178ccc8040197057e3277896b3dc12
1.7
""" Network definitions from https://github.com/ferrine/hyrnn """ import geoopt import geoopt.manifolds.stereographic.math as gmath import numpy as np import torch.nn import torch.nn.functional from torch.cuda.amp import autocast def mobius_linear( input, weight, bias=None, hyperbolic...
[ "torch.cuda.amp.autocast" ]
1.7.0
jacv050/hyperfuture
54288230656c7a8cc0b825f9e397d690408d9e42
0.4
""" SparseNet for ImageNet-1K, implemented in PyTorch. Original paper: 'Sparsely Aggregated Convolutional Networks,' https://arxiv.org/abs/1801.05895. """ __all__ = ['SparseNet', 'sparsenet121', 'sparsenet161', 'sparsenet169', 'sparsenet201', 'sparsenet264'] import os import math import torch import torch.nn ...
[ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.init.kaiming_uniform_", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.randn" ]
0.4.0
oliviaweng/imgclsmob
a1f1f52eecbb841fa878bff4d3c311b79864835d
1.7
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse from typing import Callable, List, Optional import torch from fairseq import utils from fairseq.data.indexed_dataset import g...
[ "torch.cuda.device_count" ]
1.7.1
jaehwlee/K-wav2vec
6ba33f0ef7d2399e4c52a3c80d83a092dac4daa9
1.4
import torch.nn as nn import torch.nn.functional as F import numpy as np from tool.region_loss import RegionLoss from tool.yolo_layer import YoloLayer from tool.config import * from tool.torch_utils import * class Mish(torch.nn.Module): def __init__(self): super().__init__() def forward(self, x): ...
[ "torch.nn.Linear", "torch.nn.functional.avg_pool2d", "torch.nn.MSELoss", "torch.nn.ModuleList", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.Softmax", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.Sigmoid", "torch.nn.functional.relu", "torch.nn.ReLU", "torch.nn.L1Loss", ...
1.4.0
ajsanjoaquin/pytorch-YOLOv4
dbc10cdc43668f29647ea2019ec13c4109d590c1
1.7
#!/usr/bin/env python3 import unittest import torch from gpytorch.lazy import CholLazyTensor, TriangularLazyTensor from gpytorch.test.lazy_tensor_test_case import LazyTensorTestCase class TestCholLazyTensor(LazyTensorTestCase, unittest.TestCase): seed = 0 should_test_sample = True should_call_cg = Fals...
[ "torch.eye", "torch.tensor" ]
1.7
lrast/gpytorch
2e0bbc9f59e4b4b54780c3e55db784c3d2c9a5bf
1.7
#!/usr/bin/env python3 import math import unittest import torch from gpytorch.kernels import CosineKernel class TestCosineKernel(unittest.TestCase): def test_computes_periodic_function(self): a = torch.tensor([[4, 1], [2, 2], [8, 0]], dtype=torch.float) b = torch.tensor([[0, 0], [2, 1], [1, 0]]...
[ "torch.zeros", "torch.cos", "torch.Size", "torch.norm", "torch.tensor" ]
1.7
lrast/gpytorch
2e0bbc9f59e4b4b54780c3e55db784c3d2c9a5bf
1.7
#!/usr/bin/env python3 import torch from ..utils.broadcasting import _pad_with_singletons from ..utils.getitem import _equal_indices, _noop_index from ..utils.memoize import cached from .lazy_tensor import LazyTensor from .matmul_lazy_tensor import MatmulLazyTensor from .non_lazy_tensor import NonLazyTensor, lazify ...
[ "torch.is_tensor", "torch.equal" ]
1.7
lrast/gpytorch
2e0bbc9f59e4b4b54780c3e55db784c3d2c9a5bf
1.3
#!/usr/bin/env python3 import math import warnings import torch from .. import settings from ..distributions import MultivariateNormal from ..lazy import ( BatchRepeatLazyTensor, CachedCGLazyTensor, CholLazyTensor, DiagLazyTensor, MatmulLazyTensor, PsdSumLazyTensor, RootLazyTensor, ) from...
[ "torch.cat", "torch.equal", "torch.no_grad" ]
1.3
Xiao-dong-Wang/gpytorch
92e07cf4dae26083fe0aed926e1dfd483443924e
1.9
"""Structural Regularization for """ from torch.nn.parameter import Parameter from allennlp.common import Registrable from allennlp.data.vocabulary import Vocabulary from pathlib import Path from networkx.exception import NetworkXException from typing import List, Tuple, Union, Dict, Any, Optional import torch import n...
[ "torch.ger", "torch._C._nn._parse_to", "torch.nn.parameter.Parameter", "torch.sum" ]
1.9.0
iesl/box-mlc
15439b7e46885458d0c45d530c17f1deac0398f8
1.2
import torch from src.solver import BaseSolver from src.asr import ASR from src.optim import Optimizer from src.data import load_dataset from src.util import human_format, cal_er, feat_to_fig class Solver(BaseSolver): ''' Solver for training''' def __init__(self, config, paras, mode): super().__init...
[ "torch.nn.NLLLoss", "torch.no_grad", "torch.nn.CTCLoss", "torch.cuda.empty_cache", "torch.nn.CrossEntropyLoss", "torch.sum" ]
1.2.0
voidism/End-to-end-ASR-Pytorch
509c389fa6ab98c30e227c6f4c8f7474adbc1bb2
1.10
# an implementation of PPO algorithm # reference to: https://github.com/nikhilbarhate99/PPO-PyTorch import torch import torch.nn as nn from torch.optim import Adam, RMSprop from torch.distributions import Categorical from torch.utils.tensorboard.writer import SummaryWriter from torch.utils.data import BatchSampler, Ran...
[ "torch.nn.Linear", "torch.distributions.Categorical", "torch.stack", "torch.nn.MSELoss", "torch.nn.Softmax", "torch.min", "torch.FloatTensor", "torch.nn.LeakyReLU", "torch.no_grad", "torch.clamp", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.load", "torch.exp" ]
1.10
fightZero/fightZero
84c2f76c7dda31837d002e47cd74936044251079
1.1
import argparse import pickle import torch import os import numpy as np from src.models.api import EvaluationModel, NegSampleGenerator from torch import nn class Namespace: def __init__(self, **kwargs): self.__dict__.update(kwargs) class DistMult: def get_score(self, head: torch.tensor, relation: t...
[ "torch.tensor", "torch.nn.Parameter" ]
1.1.0
wang-yuhao/Practical-Big-Data-Science-ADL-AI
0bf63bf210f506e287f8492e716bb3394137d74b
1.1
# coding=utf-8 import torch from torch import nn import numpy as np from src.models.api import AbstractModel, evaluate class DistMult(AbstractModel): def __init__( self, num_entities: int, num_relations: int, embedding_dim: int, ): super(DistMult, self)...
[ "torch.device", "torch.nn.Embedding", "torch.sum" ]
1.1.0
wang-yuhao/Practical-Big-Data-Science-ADL-AI
0bf63bf210f506e287f8492e716bb3394137d74b
1.6
import time import torch from tqdm import tqdm import pytorch_warmup as warmup import numpy as np import random import cv2 from lanedet.models.registry import build_net from .registry import build_trainer, build_evaluator from .optimizer import build_optimizer from .scheduler import build_scheduler from lanedet.datase...
[ "torch.manual_seed", "torch.no_grad" ]
1.6.0
zhangzhongshuai/lanedet
bff96fcbed122ac0f876d8e64ada7795ca34e4b6
1.4
"""Module for (demo) viewer.""" import os from dataclasses import dataclass from glob import glob from logging import getLogger from os.path import basename, join from typing import List, Optional, Tuple import cv2 import numpy as np import seaborn as sns import torch import torch.cuda import torchvision from hydra.u...
[ "torch.no_grad", "torch.cuda.is_available", "torch.load" ]
1.4.0
skmatz/frcnn
eae9d42f964a5883f72dc294984c019b3c75e837
1.6
# Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
[ "torch.zeros", "torch.nn.init.constant_", "torch.no_grad", "torch.inverse", "torch.ones", "torch.jit.load", "torch.jit.save", "torch.tensor", "torch.testing.assert_allclose", "torch.cuda.is_available", "torch.jit.script", "torch.set_grad_enabled", "torch.reshape" ]
1.6
yiheng-wang-nv/MONAI
885d5b947aeafc1a9bee2899cfd48fff9036e68a
1.9
#!/usr/bin/env python # coding=utf-8 # Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.ap...
[ "torch.tensor" ]
1.9
michaelbenayoun/optimum
21c5809577e2ef5687f293d31d1d3e28288e1bb7
1.3
""" Entry point for training and evaluating a dependency parser. This implementation combines a deep biaffine graph-based parser with linearization and distance features. For details please refer to paper: https://nlp.stanford.edu/pubs/qi2018universal.pdf. """ """ Training and evaluation for the parser. """ import s...
[ "torch.cuda.manual_seed", "torch.manual_seed", "torch.cuda.is_available" ]
1.3.0
de9uch1/stanza
cafb7d5004842cd3c8a3ac334ce7649bac928830
1.3
""" A trainer class to handle training and testing of models. """ import sys import numpy as np from collections import Counter import logging import torch from torch import nn import torch.nn.init as init import stanza.models.common.seq2seq_constant as constant from stanza.models.common.seq2seq_model import Seq2SeqM...
[ "torch.save", "torch.load" ]
1.3.0
de9uch1/stanza
cafb7d5004842cd3c8a3ac334ce7649bac928830
1.6
import torch import torch.nn as nn from torch.nn.functional import mse_loss class PSNRLoss(nn.Module): r"""Creates a criterion that calculates the PSNR between 2 images. Given an m x n image, the PSNR is: .. math:: \text{PSNR} = 10 \log_{10} \bigg(\frac{\text{MAX}_I^2}{MSE(I,T)}\bigg) where ...
[ "torch.nn.functional.mse_loss", "torch.is_tensor", "torch.tensor", "torch.log10" ]
1.6.0
pmeier/kornia
57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf
1.6
from typing import Tuple, List, Union, cast import torch import torch.nn as nn from kornia.geometry.transform.affwarp import rotate def normalize_kernel2d(input: torch.Tensor) -> torch.Tensor: r"""Normalizes both derivative and smoothing kernel. """ if len(input.size()) < 2: raise TypeError("inp...
[ "torch.zeros", "torch.device", "torch.stack", "torch.arange", "torch.linspace", "torch.clamp", "torch.ones", "torch.tensor" ]
1.6.0
pmeier/kornia
57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf
1.2
from __future__ import absolute_import import torch.nn as nn import math __all__ = ["resnet"] class BasicBlock(nn.Module): expansion = 1 def __init__(self, inplanes, planes, stride=1, downsample=None): super(BasicBlock, self).__init__() self.conv1 = nn.Conv2d( inplanes, planes, ...
[ "torch.nn.Linear", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ]
1.2.0
awwong1/ml-research
6f0bb585fef0c4567a5f02937fea62726b9c88dd
1.0
""" Library for extracting interesting quantites from autograd, see README.md Not thread-safe because of module-level variables Notation: o: number of output classes (exact Hessian), number of Hessian samples (sampled Hessian) n: batch-size do: output dimension (output channels for convolution) di: input dimension (i...
[ "torch.symeig", "torch.sqrt", "torch.stack", "torch.nn.functional.unfold", "torch.einsum", "torch.eye", "torch.nn.functional.softmax", "torch.diag", "torch.sum" ]
1.0
shyhuai/kfac_pytorch
f5a99366fa94345697432a8aabdc5d370f68d06f
0.4
#!/usr/bin/env python3 """Script to test a pytorch model on Cifar100's validation set.""" import argparse import logging import pprint import sys import time import torch from torch import nn from models import model_factory import opts import utils import mul_cifar100 def parse_args(argv): """Parse arguments ...
[ "torch.no_grad" ]
0.4.0
chrisqqq123/FA-Dist-EfficientNet
cb788b0f212d568d9bf04a51516d79fed5383585
1.0
# coding=utf-8 # Copyright 2020-present the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
[ "torch.distributed.get_world_size", "torch.cat", "torch.utils.data.dataloader.DataLoader", "torch.utils.data.sampler.RandomSampler", "torch.cuda.amp.autocast", "torch.no_grad", "torch.nn.parallel.DistributedDataParallel", "torch.utils.data.sampler.SequentialSampler", "torch.tensor", "torch.utils.d...
1.0
silvershine157/transformers
fd01104435914dd65c34026dcec8be008c40ee60
1.0
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: Donny You (youansheng@gmail.com) # Class Definition for GAN. import time import torch from datasets.gan.data_loader import DataLoader from methods.tools.runner_helper import RunnerHelper from methods.tools.trainer import Trainer from models.gan.model_manager imp...
[ "torch.no_grad" ]
1.0.1
MendelXu/ANN
f4eabeb27dbba5c9bdcf83d03776bffa34995666
1.4
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
[ "torch.rand", "torch.tensor" ]
1.4
xxxhycl2010/pytorch-lightning
7e18b118449133a5184b9014082ff1fb9818cf9b
1.0
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "torch.cat", "torch.ones", "torch.manual_seed", "torch.tensor", "torch.allclose" ]
1.0
katarinaslama/transformers-1
a5a8eeb772b185b0746f3ce9be6ae43181d2ca71
1.9
from logging import getLogger from typing import Dict, List, Optional, Tuple, Union import torch from torch import nn from torch.onnx import export logger = getLogger(__name__) def export_to_onnx( model: nn.Module, dummy_input: [Union[Tuple], torch.Tensor], file, opset_version: int = 12, input_n...
[ "torch.onnx.export" ]
1.9.0
esceptico/squeezer
98bc4c7923c6aa3b12ac81444d79392826fc34c6
1.7
import pandas as pd pd.options.mode.chained_assignment = None import numpy as np from clinicaldg.eicu.data_extraction.data_extraction_mortality import data_extraction_mortality import clinicaldg.eicu.Constants as Constants from sklearn.preprocessing import StandardScaler, LabelEncoder from torch.utils.data import Conca...
[ "torch.utils.data.ConcatDataset" ]
1.7.0
MLforHealth/ClinicalDG
2de4a8e155231f07d80036504a6f49b50004654e
1.4
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. # pylint: disable=missing-module-docstring # pylint: disable=missing-class-docstring # pylint: disable=missing-function-d...
[ "torch.nn.Linear", "torch.device", "torch.rand", "torch.optim.lr_scheduler.StepLR", "torch.distributed.init_process_group", "torch.optim.SGD", "torch.multiprocessing.spawn", "torch.nn.L1Loss", "torch.cuda.device_count", "torch.cuda.is_available", "torch.tensor", "torch.distributed.all_reduce" ...
1.4.0
joshim5/fairscale
1c2a6f6b46646866f3e86d628b8a4ca437f68215
1.8
import torch import torch.nn as nn from utils import binary_accuracy from sklearn.metrics import precision_recall_fscore_support import numpy as np only_one_iteration = False def train(model, iterator, optimizer, criterion, device): epoch_loss = 0 epoch_acc = 0 precission = 0 recall = 0 f1 = 0 ...
[ "torch.sigmoid", "torch.no_grad" ]
1.8.1
trusthlt/dp-across-nlp-tasks
ec3e03511420044cdb0bb1a3574925d354ff03f4
1.5
import os import time import ujson as json import torch import sys import pickle import numpy as np from torch.utils.data import Dataset import torch.distributed as dist import torch.nn.functional as F from bootleg.symbols.alias_entity_table import AliasEntityTable from bootleg.symbols.constants import * from bootleg....
[ "torch.nn.functional.one_hot", "torch.from_numpy", "torch.ones", "torch.tensor", "torch.bernoulli", "torch.distributed.barrier" ]
1.5.0
mleszczy/bootleg
162d74001cdfbbe146753393641d549e0328acb1
1.0
""" """ from __future__ import division from torch.optim.optimizer import Optimizer, required import numpy as np import torch from typing import NamedTuple, List from dataclasses import dataclass from enum import Enum from typing import Union, Tuple # from scipy.sparse.linalg import svds from scipy.optimize import mi...
[ "torch.reshape", "torch.sqrt", "torch.svd", "torch.diag", "torch.clone", "torch.mean", "torch.sum" ]
1.0
MathieuTuli/transformers
da3db8ba7a18deed492808b0d6c5d29669241fa0
1.7
# coding: UTF-8 import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import warnings warnings.filterwarnings("ignore") import argparse import numpy as np import shutil import PIL import time from imageio import imread, imsave from googletrans import Translator import torch import torchvision import torch.nn.functional as ...
[ "torch.rfft", "torch.rand", "torch.view_as_real", "torch.no_grad", "torch.optim.Adam", "torch.irfft", "torch.fft.irfftn", "torch.view_as_complex", "torch.clip", "torch.cuda.empty_cache", "torch.fft.rfftn" ]
1.7.1
ksburaya/aphantasia
de9d430dee7108abfcb1b19eb2d8d806b8e5d899
0.4
from __future__ import absolute_import from __future__ import division from __future__ import print_function from abc import ABC import torch import torch.nn as nn import torch.nn.functional as F from lib.loss.loss_helper import FSAuxCELoss, FSAuxRMILoss from lib.utils.tools.logger import Logger as Log class Pixel...
[ "torch.zeros", "torch.cat", "torch.unique", "torch.arange", "torch.max", "torch.unbind", "torch.nn.functional.interpolate", "torch.randperm", "torch.ones_like", "torch.transpose", "torch.log", "torch.exp" ]
0.4.1
wenguanwang/ContrastiveSeg
9a381b9799c16d81e18d8f9f25ab509b93fb56de
1.3
# Copyright (c) 2021 Sen Wu. All Rights Reserved. """Helper function to set random seed for reproducibility of models.""" import logging import random from typing import Optional import numpy as np import torch logger = logging.getLogger(__name__) def set_random_seed(seed: Optional[int] = None) -> None: """S...
[ "torch.manual_seed" ]
1.3.1
KeAWang/emmental
dae9f9fbba944f7c8404ab85aa9296545db1b82b
0.3
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved r""" Batch acquisition functions using the reparameterization trick in combination with (quasi) Monte-Carlo sampling. See [Rezende2014reparam]_ and [Wilson2017reparam]_ .. [Rezende2014reparam] D. J. Rezende, S. Mohamed,...
[ "torch.is_tensor", "torch.sigmoid" ]
0.3.5
BradyBromley/botorch
270599207f5b9bf8c66e1197ad2632bb69c3d3b9
1.4
import io import os import random import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from PIL import Image def resize_axis(tensor, axis, new_size, fill_value=0, random_sampling=False): """Truncates or pads a tensor to new_size on on a given axis. Truncate or extend tensor s...
[ "torch.narrow", "torch.randint", "torch.ones_like", "torch.Tensor", "torch.nn.CrossEntropyLoss", "torch.clamp_min" ]
1.4.0
glee1228/segment_temporal_context_aggregation
e5778f848f1cfd89bd1f77beb5e1b38a66a2f13d
1.7
import copy import torch import logging import numpy as np from sacred import Experiment from noge.data_loaders import get_datasets, get_test_loader, get_train_generator from noge.factory import make_env, make_memory from noge.network import make_network from noge.agent import Actor, main_loop, loop_ing from noge.trai...
[ "torch.cuda.is_available", "torch.device", "torch.nn.MSELoss" ]
1.7.1
johny-c/noge
88e68ba8c51ff0d63577991e233e9110cb76e228
1.8
import os import torch from typing import List from dqc.utils.datastruct import CGTOBasis __all__ = ["loadbasis"] _dtype = torch.double _device = torch.device("cpu") def loadbasis(cmd: str, dtype: torch.dtype = _dtype, device: torch.device = _device, requires_grad: bool = False) -> \ ...
[ "torch.device", "torch.tensor" ]
1.8
Jaikinator/dqc
47c964c7d1323a35f4f69521d40476c41843810e
1.8
from typing import overload, Tuple import torch __all__ = ["BaseOrbParams", "QROrbParams", "MatExpOrbParams"] class BaseOrbParams(object): """ Class that provides free-parameterization of orthogonal orbitals. """ @overload @staticmethod def params2orb(params: torch.Tensor, coeffs: torch.Tensor...
[ "torch.zeros", "torch.triu_indices", "torch.linalg.qr", "torch.matrix_exp", "torch.tensor", "torch.mean" ]
1.8
Jaikinator/dqc
47c964c7d1323a35f4f69521d40476c41843810e
1.9
import torch from recstudio.ann import sampler from recstudio.data import dataset from recstudio.model import basemodel, loss_func, scorer r""" HGN ######## Paper Reference: Chen ma, et al. "HGN: Hierarchical Gating Networks for Sequential Recommendation" in KDD2019. https://dl.acm.org/doi/abs/10.1145/3292500...
[ "torch.nn.Linear", "torch.empty", "torch.nn.Embedding", "torch.max" ]
1.9.0
ustc-recsys/Torchrec
4d62ee42018c12961850936cfd8f4f8d3c6a8dbc
1.8
import pytest import numpy as np import torch from doctr.models.preprocessor import PreProcessor @pytest.mark.parametrize( "batch_size, output_size, input_tensor, expected_batches, expected_value", [ [2, (128, 128), np.full((3, 256, 128, 3), 255, dtype=np.uint8), 1, .5], # numpy uint8 [2, (1...
[ "torch.no_grad", "torch.ones", "torch.all", "torch.full" ]
1.8.0
mzeidhassan/doctr
14b376e07d31b09b6bd31bceebf6ffb477c30f08
1.8
import os from pathlib import Path from typing import Callable, Optional, Tuple, Union import torchvision from torch import nn from torch.utils.data import DataLoader, Dataset from torchvision import transforms from torchvision.datasets import STL10, ImageFolder def build_custom_pipeline(): """Builds augmentatio...
[ "torch.utils.data.DataLoader" ]
1.8.1
fariasfc/solo-learn
f53ff40edbc7e96e06db5238d8c3a44f7b8965c1
1.8
import torch import torch.nn.functional as F def invariance_loss(z1: torch.Tensor, z2: torch.Tensor) -> torch.Tensor: """Computes mse loss given batch of projected features z1 from view 1 and projected features z2 from view 2. Args: z1 (torch.Tensor): NxD Tensor containing projected features from...
[ "torch.nn.functional.mse_loss", "torch.nn.functional.relu", "torch.eye" ]
1.8.1
fariasfc/solo-learn
b75ba6faf5269b0849120bfb89593f9bc23e09bc
1.7
import json import os import sys import time import torch from training.training import Trainer from data.conversion import GridDataConverter, PointCloudDataConverter, ERA5Converter from data.dataloaders import mnist, celebahq from data.dataloaders_era5 import era5 from data.dataloaders3d import shapenet_voxels, shapen...
[ "torch.zeros", "torch.nn.Identity", "torch.nn.Tanh", "torch.nn.LeakyReLU", "torch.cuda.is_available" ]
1.7.0
EmilienDupont/neural-function-distributions
c034bf79640c6d8922f1c276174b3cb1800d22b4
0.4
from __future__ import print_function import argparse import torch.backends.cudnn as cudnn import torch.nn.functional as F import torch.optim as optim import torch.utils.data.distributed from torchvision import models import horovod.torch as hvd import timeit import numpy as np # Benchmark settings parser = argparse....
[ "torch.nn.functional.cross_entropy" ]
0.4.0
zmldndx/horovod
e9b1e228ff92eb7f65d9aea2d36f23b327df28bd
1.9
from typing import ClassVar, List, Optional, Tuple, Callable, Union, cast import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.distributions as D from alphazero.network.distributions import SquashedNormal, GeneralizedBeta from alphazero.network.utils import ( _map_nonli...
[ "torch.nn.Linear", "torch.distributions.Categorical", "torch.nn.LayerNorm", "torch.nn.Sequential", "torch.no_grad", "torch.distributions.Normal", "torch.clamp", "torch.distributions.Beta", "torch.nn.functional.softmax", "torch.distributions.MixtureSameFamily" ]
1.9.0
timoklein/A0C
2825193f424bd5b74b654c929ef73775b0914ee5
1.6
import os os.environ["CUDA_VISIBLE_DEVICES"] = "1" # import deepspeed # import mpi4py # import pandas import torch import transformers import wandb #%env WANDB_PROJECT=wine_gpt2_Trainer_42 MODEL_NAME = "gpt2-medium" # wandb.login(anonymous='never', key="222a37baaf0c1b0d1499ec003e5c2fe49f97b107") wandb.init() # wan...
[ "torch.cuda.is_available", "torch.tensor" ]
1.6.0
cipher982/Wine-o-matic
a8000bf5ec86554e9c3c746aae51ba509ab59162
1.7
import torch import torchvision from torchvision import transforms, utils, datasets from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler from sklearn.metrics import classification_report, confusion_matrix def makeDataSet(IMAGE_SHAPE = 300,DATA_PATH = './data_after_splitting/'): image_transforms = {...
[ "torch.utils.data.DataLoader" ]
1.7.1
manhph2211/Pytorch-Fb-Classification
cf5f9c0b356635020ff245c255d971e450d203fb
1.2
"""Adapted from: @longcw faster_rcnn_pytorch: https://github.com/longcw/faster_rcnn_pytorch @rbgirshick py-faster-rcnn https://github.com/rbgirshick/py-faster-rcnn Licensed under The MIT License [see LICENSE for details] """ from __future__ import print_function import torch import torch.nn as nn import to...
[ "torch.cuda.is_available", "torch.load", "torch.masked_select", "torch.set_default_tensor_type" ]
1.2
FLyingLSJ/ssd.pytorch
9caca0788f0bebab345f969a7d3c1f8b2081b809
1.3
import os import sys import errno import random import pickle import numpy as np import torch import torchvision import torch.nn.functional as F from torch.utils.data.dataset import Dataset from torch.utils.data import Dataset, DataLoader from torch.utils.data.sampler import BatchSampler from torchvision.datasets imp...
[ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.max_pool2d" ]
1.3.1
kaderghal/ADNI_Data_processing
454462d3913d77e3bc4de2b9725b456301c7b351
3
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import argparse import logging import multiprocessing as mp import numpy as np import os import torch from detectron2.config import get_cfg from detectron2.data import MetadataCatalog from detectron2.da...
[ "torch.device", "torch.stack", "torch.tensor" ]
3
ishanic/MeshRCNN-keypoints
fdc2c81ce57313207478ab9ff1699614addc5993
1.6
from math import log, exp from numpy import inf, zeros, zeros_like as np_zeros_like, arange, asarray, empty from pandas import concat from anndata import AnnData from torch import cat, no_grad, randn, zeros_like, zeros as torch_zeros, ones, argmax from torch.nn import Module, Linear, Sequential, RNNCell, Softplus, Par...
[ "torch.nn.Linear", "torch.optim.lr_scheduler.StepLR", "torch.nn.RNNCell", "torch.nn.Softmax", "torch.nn.Sequential", "torch.no_grad", "torch.zeros_like", "torch.argmax" ]
1.6.1
jlakkis/sciPENN
34afb2008a076e13c40965a76d3dd31d0c331652
0.4
# MIT License # Copyright (c) 2018 the NJUNMT-pytorch authors. # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, m...
[ "torch.cuda.manual_seed_all", "torch.autograd.backward", "torch.enable_grad", "torch.no_grad", "torch.manual_seed", "torch.cuda.is_available", "torch.tensor", "torch.load" ]
0.4.0
skysky77/MGNMT
19dded399a310cd118eee09bd37d657746d11cf1
1.4
import sys sys.path.append('../') import torch import numpy as np import random import math import time import argparse from data_tlp_cite import DataHelper_t from torch.utils.data import DataLoader from model import Model from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRe...
[ "torch.cat", "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "torch.manual_seed", "torch.abs", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load" ]
1.4.0
WenZhihao666/TREND
ca4b17139b5f24d44d9421fed92021eb7a95ed6d
1.6
# -*- coding: utf-8 -*- # @Time : 2020/10/3 # @Author : Changxin Tian # @Email : cx.tian@outlook.com r""" KGNNLS ################################################ Reference: Hongwei Wang et al. "Knowledge-aware Graph Neural Networks with Label Smoothness Regularization for Recommender Systems." in KDD 2019....
[ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.ones", "torch.logical_and", "torch.nn.BCEWithLogitsLoss", "torch.reshape", "torch.mul", "torch.nn.Softmax", "torch.unsqueeze", "torch.logical_not", "torch.index_select", "torch.nn.Embedding", "torch.nn.Tanh", "torch.nn.ReLU", ...
1.6.0
xingkongxiaxia/xx
ce51d75406592d6bc25bb803f773f0788496fd97
1.6
# -*- coding: utf-8 -*- # @Time : 2020/10/6 # @Author : Changxin Tian # @Email : cx.tian@outlook.com r""" KGCN ################################################ Reference: Hongwei Wang et al. "Knowledge graph convolution networks for recommender systems." in WWW 2019. Reference code: https://github.com/hww...
[ "torch.nn.Linear", "torch.index_select", "torch.cat", "torch.mul", "torch.nn.ModuleList", "torch.nn.Softmax", "torch.nn.Tanh", "torch.unsqueeze", "torch.nn.ReLU", "torch.from_numpy", "torch.mean", "torch.nn.BCEWithLogitsLoss", "torch.flatten", "torch.nn.Embedding", "torch.reshape" ]
1.6.0
xingkongxiaxia/xx
ce51d75406592d6bc25bb803f773f0788496fd97
0.4
import os import click import numpy as np from tqdm import tqdm from models.model_loader import load_model from torchvision.transforms import Compose from dataset.data_transform import Resize, Rotation, ElasticAndSine, ColorGradGausNoise, AddWidth, Normalize, ToGray, OnlyElastic, OnlySine, ColorGrad, ColorGausNoise fro...
[ "torch.nn.NLLLoss", "torch.zeros", "torch.autograd.Variable", "torch.ones", "torch.utils.data.DataLoader" ]
0.4.0
alexeypechorin/tibetan-transductive
e2356d5c0a7cbc2f2359d9cf5b6b18729fecd8de
1.6
import torch from nnunet.network_architecture.generic_UNet import Generic_UNet from nnunet.network_architecture.initialization import InitWeights_He from nnunet.training.network_training.nnUNet_variants.data_augmentation.nnUNetTrainerV2_insaneDA import \ nnUNetTrainerV2_insaneDA from nnunet.utilities.nd_softmax imp...
[ "torch.cuda.is_available" ]
1.6.0
nasyxx/nnUNet
92d5f2352349eed278e22f7a38cb86b0fccd7c75
0.4
import torch import torch.nn as nn #from .utils import load_state_dict_from_url from .utils import zerocenter __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152', 'resnext50_32x4d', 'resnext101_32x8d', 'wide_resnet50_2', 'wide_resnet101_2'] model_urls = { 'res...
[ "torch.nn.Linear", "torch.flatten", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ]
0.4.0
vinnamkim/segmentation_models.pytorch
f967ded34df6fb536e8e8cba9b6491ae63b939f5
1.10
""" The file contains the PPO class to train with. NOTE: All "ALG STEP"s are following the numbers from the original PPO pseudocode. It can be found here: https://spinningup.openai.com/en/latest/_images/math/e62a8971472597f4b014c2da064f636ffe365ba3.svg """ import gym import numpy as np import torch i...
[ "torch.distributions.Categorical", "torch.nn.MSELoss", "torch.min", "torch.clamp", "torch.manual_seed", "torch.full", "torch.tensor", "torch.load", "torch.diag", "torch.distributions.MultivariateNormal", "torch.exp", "torch.utils.tensorboard.SummaryWriter" ]
1.10.0
britig/S2RL-Policies
b9c74b7f5efec225920c09f7e8e82d8555d61bd9
0.1
# Copyright (c) Facebook, Inc. and its affiliates. import os import warnings # import git import torch import yaml from pythia.common.registry import registry from pythia.utils.distributed_utils import is_main_process, synchronize from pythia.utils.general import (ckpt_name_from_core_args, ...
[ "torch.save", "torch.load" ]
0.1.6
zean-wen/mmgnn_textvqa
2cfe82ed54610975a1d4937f2032e5f4565ecbe7
1.0
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors, # The HuggingFace Inc. team, and The XTREME Benchmark Authors. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with th...
[ "torch.distributed.get_world_size", "torch.cat", "torch.utils.data.RandomSampler", "torch.amax", "torch.cuda.is_available", "torch.load", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel", "torch.distributed.init_process_group", "torch.FloatTensor", "torch.manual_seed", "torch.autograd.grad...
1.0
rohanshah13/cloud-emea-copy
12acebc809080e5898ead86a412b17a5272759c2
1.4
import numpy as np from time import sleep import torch import torch.nn as nn import torch.nn.functional as F from core.models.common_layers import batch_norm, get_nddr from core.tasks import get_tasks from core.utils import AttrDict from core.utils.losses import poly class SingleTaskNet(nn.Module): def __init__...
[ "torch.nn.ModuleList", "torch.nn.ModuleDict", "torch.nn.functional.interpolate", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.Dropout2d" ]
1.4.0
WZzhaoyi/MTLNAS
c04fcce1437eef306a41a6a224551be99d88f9a3
1.7
"""Provide useful functions for using PTLFlow.""" # ============================================================================= # Copyright 2021 Henrique Morimitsu # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a...
[ "torch.device", "torch.cuda.is_available", "torch.hub.get_dir" ]
1.7.0
hmorimitsu/ptlflow
26f753322aef91b95ad78e743d847064e5d531b9
1.4
"""Rectify function""" import torch from torch.autograd import Function from encoding import cpu if torch.cuda.device_count() > 0: from encoding import gpu __all__ = ['rectify'] class _rectify(Function): @staticmethod def forward(ctx, y, x, kernel_size, stride, padding, dilation, average): ctx.s...
[ "torch.cuda.device_count" ]
1.4.0
Womcos/SCARF
b90251bc23410cb810a7082ca75147a7aae21dec
1.7
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
[ "torch.utils.data._utils.collate.default_collate", "torch.stack" ]
1.7.1
Isaac-Flath/lightning-flash
320f87707587d92a13c8831778864b33af4fe421
1.1
# Copyright 2021 Tomoki Hayashi # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """GAN-based TTS ESPnet model.""" from contextlib import contextmanager from distutils.version import LooseVersion from typing import Any from typing import Dict from typing import Optional import torch from typeguard import...
[ "torch.cuda.amp.autocast" ]
1.1.0
actboy/espnet
66f0f8382b0e1195bed7c280c29711f8436b3db4
1.6
# Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
[ "torch.nn.Sigmoid", "torch.add", "torch.manual_seed", "torch.cuda.is_available", "torch.nn.BCELoss" ]
1.6
Can-Zhao/MONAI
e0db5a564225a7cb62e7a23df97267019006302f
1.6
# Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
[ "torch.nn.functional.grid_sample", "torch.stack", "torch.arange" ]
1.6
Can-Zhao/MONAI
e0db5a564225a7cb62e7a23df97267019006302f
0.4
from __future__ import print_function import argparse import os import pickle import sys import cv2 import numpy as np import torch import vlfeat # calls constructor from sklearn.cluster import MiniBatchKMeans from src.utils.cluster.eval_metrics import _hungarian_match, _original_match, \ _acc from src.utils.segm...
[ "torch.zeros", "torch.from_numpy" ]
0.4.1
THinnerichs/MiS-Information-Clustering
597c70e1283222e0e841e24f6805b967aaf3c9e0
1.7
from copy import copy from typing import Optional import torch import pytorch_lightning as pl from transformers import ( EncoderDecoderModel, RobertaModel, RobertaConfig, GPT2LMHeadModel, GPT2Config, RobertaTokenizer, GPT2Tokenizer, AdamW, get_linear_schedule_with_warmup, ) import ...
[ "torch.stack" ]
1.7.0
saridormi/commit_message_generation
c25db61a5f41accfb566caaea5feb0d275751293
1.7
# -*- coding: utf-8 -*- import torch from supar.utils.common import MIN from supar.utils.fn import pad from torch.autograd import Function def tarjan(sequence): r""" Tarjan algorithm for finding Strongly Connected Components (SCCs) of a graph. Args: sequence (list): List of head indi...
[ "torch.tensor", "torch.clamp" ]
1.7.1
zysite/parser
8ed9ccb8e542655fd6fd1b6f7faaf084d13a866e
1.9
# -*- coding: utf-8 -*- import os import torch import torch.nn as nn from supar.models import (BiaffineDependencyModel, CRF2oDependencyModel, CRFDependencyModel, VIDependencyModel) from supar.parsers.parser import Parser from supar.utils import Config, Dataset, Embedding from supar.utils.com...
[ "torch.no_grad", "torch.cuda.is_available" ]
1.9.0
LiBinNLP/HOSDP
f0806d1c27c9d5233002836e1825a1567891d928
1.0
import os import numpy as np import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import torch from torch.utils.data import DataLoader from tqdm import tqdm import argparse import cv2 import config from utils import Mesh from models import CMR from models.smpl_from_lib import SMPL from utils.pose_ut...
[ "torch.device", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.matmul" ]
1.0.0
akashsengupta1997/GraphCMR
0b8b05be4f711995ba50e414effbde98b6b11c5b
1.5
import logging from collections import OrderedDict from pathlib import Path from typing import List, Optional, Set, Tuple, Union import numpy as np import torch from sklearn.metrics.pairwise import cosine_similarity from sklearn.preprocessing import minmax_scale from tqdm import tqdm import flair from flair.data impo...
[ "torch.no_grad", "torch.argmax" ]
1.5.0
marleneDebatin/flair
4d17509f358158f66d43e85db1b6990523b0b095
1.8
import torch import random import numpy as np class InfiniteDataLoader(torch.utils.data.DataLoader): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.dataset_iterator = super().__iter__() def __iter__(self): return self def __next__(self): ...
[ "torch.manual_seed", "torch.cuda.manual_seed_all" ]
1.8.2
gmberton/CosPlace
0f03cc9fe25919c87627e92535f3693747617eae