version
stringclasses
21 values
code
stringlengths
225
174k
apis
list
full_version
stringlengths
1
6
repo_name
stringlengths
10
107
hexsha
stringlengths
40
40
1.3
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function, absolute_import import argparse import time import os.path as osp import os import numpy as np import torch from torch import nn from torch.nn import init from torch.backends import cudnn from torch.utils.data import DataLoader from ...
[ "torch.nn.functional.normalize", "torch.from_numpy", "torch.manual_seed", "torch.nn.DataParallel", "torch.pow" ]
1.3.1
TencentYoutuResearch/PersonReID-ACT
264b1b43f9424c297638ebf6f8f8ace09512ed29
1.4
# -*- coding: utf-8 -* from paths import ROOT_PATH # isort:skip from videoanalyst.config.config import cfg from videoanalyst.config.config import specify_task from videoanalyst.model import builder as model_builder from videoanalyst.pipeline import builder as pipeline_builder from videoanalyst.utils import complete_p...
[ "torch.device" ]
1.4.0
GZHermit/video_analyst
6233b19320e3d07b95fb1f782efd89b052a8cf4e
1.6
# 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.optim.lr_scheduler.StepLR" ]
1.6
PeppeSaccardi/pytorch-lightning
046110797227c352126c779c207e076ce9682eae
1.7
"""Attention networks.""" import logging import torch import torch.nn as nn import bootleg.utils.model_utils from bootleg.layers.helper_modules import MLP, AttnBlock, NormAndSum, SelfAttnBlock from bootleg.symbols.constants import ( BERT_WORD_DIM, DISAMBIG, KG_BIAS_LOAD_CLASS, MAIN_CONTEXT_MATRIX, ) f...
[ "torch.zeros", "torch.cat", "torch.nn.Softmax", "torch.nn.ModuleDict", "torch.bmm", "torch.tensor", "torch.eye", "torch.zeros_like", "torch.sum" ]
1.7.0
Mehrad0711/bootleg
f812b6200eb84b0163d353f0d4f73308a921fcfa
1.1
""" @author: Patrik Purgai @copyright: Copyright 2019, supervised-translation @license: MIT @email: purgai.patrik@gmail.com @date: 2019.04.04. """ # pylint: disable=no-member # pylint: disable=not-callable import torch import random from torch.nn.modules import ( Module, ModuleList) from torch.nn....
[ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.nn.Dropout", "torch.nn.GRU", "torch.bmm", "torch.nn.functional.embedding", "torch.nn.functional.log_softmax", "torch.nn.functional.linear", "torch.tensor", "torch.nn.functional.softmax", "torch.nn.Embedding" ]
1.1.0
Mrpatekful/supervised-translation
d03db6a0fc25900fd42b8057a12adad0b8d025f8
1.5
from typing import Iterable, Callable import torch from torch.optim import Optimizer def compute_sam(group: dict, closure: Callable): grads = [] params_with_grads = [] rho = group['rho'] # update internal_optim's learning rate for p in group['params']: if p.grad is not None: ...
[ "torch._foreach_sub_", "torch._foreach_add_", "torch._foreach_mul_" ]
1.5.0
tourdeml/SAM
08cb3cccb39157859a1c77ef1e1852120df4a790
1.9
# -*- coding: utf-8 -*- # pylint: disable=E1101 """ Deprecated. Use named_interface.BVBQMixMVN. Won't be documented due to this """ import torch from . import utils from . import bvbq from . import distributions from . import gp from . import acquisition from . import metrics class BVBQMixMVN(object): de...
[ "torch.vstack", "torch.ones" ]
1.9.0
DFNaiff/BVBQ
48f0eb624483f67b748d791efc0c06ddfb6e0646
1.2
import torch import torch.nn as nn class LabelSmoothingLoss(nn.Module): """ Provides Label-Smoothing loss. Args: class_num (int): the number of classfication ignore_index (int): Indexes that are ignored when calculating loss smoothing (float): ratio of smoothing (confidence = 1.0 -...
[ "torch.zeros_like", "torch.no_grad", "torch.sum" ]
1.2.0
ngbsLab/Korean-Speech-Recognition
3867bf7d23222da6812c9b98a93d3c6f7b3c80fc
1.9
import models.SingleLayer_net as single_layer import loss_functions.rank_based_loss as rbl # import wandb import torch import utils.data_functions as df import os import json import pandas as pd import csv os.environ['CUDA_VISIBLE_DEVICES'] = '3' # wandb.init(project='example') exp_name = 'example' # wandb.run.name ...
[ "torch.utils.data.DataLoader", "torch.load" ]
1.9.1
inesnolas/Rank-based-loss_ICASSP22
3ebe7345dc26b8fa74543725a51b43b7170c58cc
3
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. """ This module implements loading meshes from glTF 2 assets stored in a GLB container file or a glTF JSON file ...
[ "torch.FloatTensor", "torch.from_numpy" ]
3
fabibo3/pytorch3d
36b7656753ae759aed2eb7ffb432b6eca4d42fe2
1.7
import torch from torch import Tensor from kge import Config, Dataset from kge.model.kge_model import KgeModel import json import os import numpy as np import time class hmcn_model(KgeModel): """ Implements hierarchical Multi-Label classification Network as defined in Wehrmann et al. (2018) Codes ...
[ "torch.nn.Linear", "torch.sigmoid", "torch.nn.Dropout", "torch.cat", "torch.stack", "torch.nn.ModuleList", "torch.max", "torch.from_numpy", "torch.nn.ReLU", "torch.nn.init.normal_", "torch.nn.BatchNorm1d", "torch.logical_or" ]
1.7.1
LukasDegitz/kge
0ff3d2623d520e0634374e81d4184d525c189a25
1.4
# -*- coding: utf-8 -* # -------------------------------------------------------- # SNNformer Feature Extractor (SFE) - SNN branch # -------------------------------------------------------- import torch.nn as nn import torch from videoanalyst.model.backbone.backbone_base import (TRACK_BACKBONES, ...
[ "torch.zeros", "torch.min", "torch.max", "torch.nn.Sigmoid", "torch.histc", "torch.nn.BatchNorm2d", "torch.ones", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.count_nonzero", "torch.nn.AdaptiveAvgPool2d", "torch.log", "torch.mean", "torch.where" ]
1.4.0
Jee-King/STNet
221ab60c4fccfce5a03e8878fb168e0baa7152f4
1.4
# -*- coding: utf-8 -* import torch.nn as nn from videoanalyst.model.backbone.backbone_base import (TRACK_BACKBONES, VOS_BACKBONES) from videoanalyst.model.common_opr.common_block import conv_bn_relu from videoanalyst.model.module_base import ModuleBase @VOS_BA...
[ "torch.nn.MaxPool2d" ]
1.4.0
Jee-King/STNet
221ab60c4fccfce5a03e8878fb168e0baa7152f4
1.2
import math import os import signal import sys from typing import Callable, Any, Tuple, List, Union, Optional import ptan import torch import torch.nn.functional as F from tensorboardX import SummaryWriter from torch import multiprocessing from torch.optim import Adam, SGD import autograph.lib.envs.mazeenv from autog...
[ "torch.device", "torch.multiprocessing.freeze_support", "torch.multiprocessing.set_start_method", "torch.cuda.is_available", "torch.nn.functional.softmax", "torch.Tensor" ]
1.2.0
bb912/MATS-DRS
6e1ae9ba3b865e321d6a2d100d29693b776e1d36
1.4
import argparse import logging import os import string from datetime import datetime from time import time import torch import torchaudio from torch.optim import SGD, Adadelta, Adam, AdamW from torch.optim.lr_scheduler import ExponentialLR, ReduceLROnPlateau from torch.utils.data import DataLoader from torchaudio.data...
[ "torch.optim.lr_scheduler.ExponentialLR", "torch.multiprocessing.spawn", "torch.cuda.is_available", "torch.load", "torch.nn.DataParallel", "torch.distributed.init_process_group", "torch.nn.CTCLoss", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.jit.script", "torch.nn.Sequential", ...
1.4.0
zkneupper/audio
1f136671b84071a2fe1d5b762df64f3a76310c31
1.4
import torch from torchaudio.datasets import LIBRISPEECH class MapMemoryCache(torch.utils.data.Dataset): """ Wrap a dataset so that, whenever a new item is returned, it is saved to memory. """ def __init__(self, dataset): self.dataset = dataset self._cache = [None] * len(dataset) ...
[ "torch.nn.Sequential", "torch.nn.utils.rnn.pad_sequence", "torch.tensor" ]
1.4.0
zkneupper/audio
1f136671b84071a2fe1d5b762df64f3a76310c31
1.6
from unittest import mock import pytest import torch from tests import DATASETS_PATH @pytest.mark.parametrize('cli_args', [ f"--data_dir {DATASETS_PATH} --max_epochs 1 --max_steps 3 --fast_dev_run --batch_size 2" ]) def test_cli_run_self_supervised_amdim(cli_args): """Test running CLI for an example with de...
[ "torch.cuda.is_available" ]
1.6
hecoding/pytorch-lightning-bolts
4d254fde6112b21436003028d553a726bf7ea6ef
1.5
from awsio.python.lib.io.s3.s3dataset import S3Dataset from torch.utils.data import DataLoader url_list = ['s3://image-data-bucket/train/n01440764/n01440764_10026.JPEG', 's3://image-data-bucket/train/n01440764/n01440764_10027.JPEG', 's3://image-data-bucket/train/n01440764/n01440764_10029.JPEG'] dataset = S3Dataset...
[ "torch.utils.data.DataLoader" ]
1.5.1
judyheflin/amazon-s3-plugin-for-pytorch
38284c8a5e92be3bbf47b08e8c90d94be0cb79e7
1.1
from __future__ import print_function, absolute_import import time from time import gmtime, strftime from datetime import datetime from collections import OrderedDict import torch import numpy as np from random import randint from PIL import Image import sys from . import metric from metric import Accuracy, EditDistanc...
[ "torch.device", "torch.cat", "torch.no_grad", "torch.abs", "torch.nn.CosineSimilarity" ]
1.1.0
adeline-cs/GTR
889b0cda8a3c2b061371c4a63ea871821ddcd3d7
1.9
from data_loader import load_data, tokenizer from models import BertForMultipleSequenceClassification from transformers import AutoConfig import torch from tqdm.auto import tqdm from transformers import get_scheduler from transformers import AdamW from sklearn.metrics import accuracy_score, f1_score label_list = ['확진...
[ "torch.device", "torch.cat", "torch.no_grad", "torch.cuda.is_available", "torch.argmax" ]
1.9.1
Ckst123/KoBERT-events
68eb22845b179bcaf13771fea776be3d9772306f
1.2
from typing import Optional from overrides import overrides import torch from allennlp.training.metrics.metric import Metric @Metric.register("entropy") class Entropy(Metric): def __init__(self) -> None: self._entropy = 0.0 self._count = 0 @overrides def __call__( self, # type:...
[ "torch.exp", "torch.nn.functional.log_softmax" ]
1.2.0
tianjianjiang/allennlp
35b285585e0677b1025eac1c19b5eefe7e2a70db
1.2
import math from overrides import overrides import torch from torch.nn.parameter import Parameter from allennlp.modules.similarity_functions.similarity_function import SimilarityFunction from allennlp.nn import Activation, util @SimilarityFunction.register("linear") class LinearSimilarity(SimilarityFunction): "...
[ "torch.Tensor", "torch.matmul" ]
1.2.0
tianjianjiang/allennlp
35b285585e0677b1025eac1c19b5eefe7e2a70db
1.7
import torch import torch.nn as nn from torch.nn import functional as F import torchvision import torchvision.transforms as transforms from torchvision.transforms import ToTensor from torchvision.transforms import ToPILImage import os import cv2 import wget import imutils from tqdm import tqdm, tqdm_notebook from PIL ...
[ "torch.load" ]
1.7.0
kingjuno/devolearn
555c8c55441a4f0b9ed8801c37d07c45b03ec774
1.4
import os import os.path as osp import numpy as np from summit.benchmarks.experiment_emulator.emulator import Emulator import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from blitz.modules import BayesianLinear from blitz.utils import variational_estimator from sklearn.m...
[ "torch.device", "torch.cat", "torch.nn.MSELoss", "torch.nn.functional.dropout", "torch.cuda.is_available", "torch.tensor", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.utils.data.DataLoader", "torch.load", "torch.utils.data.TensorDataset" ]
1.4.0
jezsadler/summit
982de7f6424bb94da2084d4d84396b4b2673eeca
1.4
from __future__ import division import argparse import numpy as np import torch from dim_red.triplet import train_triplet from dim_red.angular import train_angular from dim_red.support_func import sanitize from dim_red.data import load_dataset if __name__ == '__main__': parser = argparse.ArgumentParser() d...
[ "torch.manual_seed", "torch.cuda.is_available" ]
1.4.0
symphony233/gbnns_dim_red
2403411600a60ad4365aba3d78a81da144a456b7
1.3
# 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.tensor" ]
1.3.1
IgorHoholko/metrics
5510ccd99eaec5ab8175bbd5e2ad9e66e82d10e4
1.8
""" taken from: https://github.com/karpathy/minGPT/ GPT model: - the initial stem consists of a combination of token encoding and a positional encoding - the meat of it is a uniform sequence of Transformer blocks - each Transformer is a sequential combination of a 1-hidden-layer MLP block and a self-attention block...
[ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.cat", "torch.isnan", "torch.no_grad", "torch.randperm", "torch.ones", "torch.multinomial", "torch.tensor", "torch.nn.functional.softmax", "torch.nn.GELU", "torch.nn.Embedding", "torch.topk" ]
1.8.1
adeptflax/image2image
8c7c531176d261789f90a27125b31d6241bc9c27
1.2
""" Example template for defining a system """ import os from argparse import ArgumentParser from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as transforms from torch import optim from torch.utils.data import DataLoader from torch.util...
[ "torch.nn.Linear", "torch.rand", "torch.nn.Dropout", "torch.nn.functional.nll_loss", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.nn.functional.log_softmax", "torch.mean", "torch.nn.BatchNorm1d", "torch.tensor", "torch.utils.data.DataLoader", "torch.utils.data.distributed.DistributedSamp...
1.2.0
ryosukehata/pytorch-lightning
a5bd2edefbafa6e03acffd4ba1a8816bbc1682a3
1.7
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import math from functools import partial __all__ = [ 'ResNet', 'resnet10', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152', 'resnet200' ] def conv3x3x3(in_planes, out_planes, stride=1): # ...
[ "torch.nn.Linear", "torch.nn.functional.avg_pool3d", "torch.cat", "torch.nn.Sequential", "torch.nn.MaxPool3d", "torch.nn.init.kaiming_normal", "torch.nn.ReLU", "torch.nn.Conv3d", "torch.nn.AvgPool3d", "torch.nn.BatchNorm3d" ]
1.7.1
Faiz99khan/ISL_hand_gesture_recognition_in_real-time
dade99478e9b37440ebe7fb7842d451582132f0a
1.6
import configparser from adapter_entity_typing.network_classes.classifiers import EarlyStoppingWithColdStart from torch.utils.data.dataloader import DataLoader from adapter_entity_typing.network import load_model from collections import defaultdict import torch import json import numpy as np from tqdm import tqdm impo...
[ "torch.utils.data.dataloader.DataLoader", "torch.nn.Sigmoid", "torch.topk" ]
1.6.0
NooneBug/adapter_on_entity_typing
b8d2850dbed47adbf21c9a8021cef69a9b5d60dd
1.7
# Copyright (c) Facebook, Inc. and its affiliates. import unittest import tests.test_utils as test_utils import torch from VisualBERT.mmf.common.sample import Sample, SampleList from VisualBERT.mmf.models.mmbt import MMBT from VisualBERT.mmf.modules.encoders import ( ImageEncoderFactory, ImageEncoderTypes, ...
[ "torch.zeros", "torch.rand", "torch.no_grad", "torch.ones", "torch.randint", "torch.jit.script", "torch.equal" ]
1.7.0
Fostereee/Transformer-MM-Explainability
6dc4925b83a38e39069369da599b11d548128eb5
1.7
# Copyright (c) Facebook, Inc. and its affiliates. """ Text utils module contains implementations for various decoding strategies like Greedy, Beam Search and Nucleus Sampling. In your model's config you can specify ``inference`` attribute to use these strategies in the following way: .. code:: model_config: ...
[ "torch.stack", "torch.FloatTensor", "torch.nn.functional.log_softmax", "torch.multinomial", "torch.tensor", "torch.nn.functional.softmax", "torch.div" ]
1.7.0
Fostereee/Transformer-MM-Explainability
6dc4925b83a38e39069369da599b11d548128eb5
1.2
""" ``KnowledgeGraphField`` is a ``Field`` which stores a knowledge graph representation. """ from typing import Callable, Dict, List, Set from collections import defaultdict import editdistance from overrides import overrides import torch from allennlp.common import util from allennlp.common.checks import Configurat...
[ "torch.FloatTensor", "torch.stack" ]
1.2.0
entslscheia/allennlp
eeba62e34c8e211ed5963f830528c957f178607b
0.4
import torch import torch.nn as nn from torch.optim import Adam from torch.utils.data import DataLoader from ..model import BERTLM, BERT from .optim_schedule import ScheduledOptim import tqdm import numpy def hook(arr, l, iNo): def trace(module, input, output): if iNo: cid = input[0].get_devi...
[ "torch.nn.NLLLoss", "torch.device", "torch.cuda.device_count", "torch.cuda.is_available", "torch.nn.DataParallel" ]
0.4.0
zinechant/BERT-pytorch
7c8bc555f29ff7ba336b38f2eddd072d7910e2bd
1.3
# 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.tensor" ]
1.3.1
hlin09/metrics
cceced613f4323a1f5124099a969f2cf32a80d7e
1.9
from torch import nn from tsl.nn.utils import utils class Dense(nn.Module): r""" A simple fully-connected layer. Args: input_size (int): Size of the input. output_size (int): Size of the output. activation (str, optional): Activation function. dropout (float, optional): D...
[ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.Identity" ]
1.9
TorchSpatiotemporal/tsl
da13493b0cf83826bf41fe78a67e8d4ce1d7a8a0
1.7
#!/usr/bin/env python from aparse import click from typing import List from viewformer.utils import SplitIndices from viewformer.data import transform_dataset # Use memory growth for tf try: import tensorflow as tf gpus = tf.config.list_physical_devices('GPU') if gpus: # Currently, memory growth ne...
[ "torch.device", "torch.cat", "torch.no_grad", "torch.cuda.device_count", "torch.from_numpy" ]
1.7.1
jkulhanek/viewformer
9ad2c5a2f7abe4b7ff490ced0132bf3d2f07e29c
1.10
import math import numpy as np import torch import torchvision import wandb from torch.nn import functional as F from torch import LongTensor from lambo import transforms as gfp_transforms, dataset as gfp_dataset from lambo.models.shared_elements import check_early_stopping from lambo.utils import str_to_tokens de...
[ "torch.distributions.Categorical", "torch.nn.functional.softmax", "torch.is_tensor", "torch.no_grad", "torch.nn.functional.log_softmax", "torch.multinomial", "torch.nn.functional.cross_entropy", "torch.utils.data.DataLoader", "torch.utils.data.BatchSampler", "torch.tensor", "torch.utils.data.Wei...
1.10.0
samuelstanton/lambo
7b67684b884f75f7007501978c5299514d0efb75
1.1
import pandas as pd from zipfile import ZipFile import torch as th import cv2 import numpy as np import os from glob import glob import pydicom from matplotlib import pyplot as plt from segmentation_model import FPNSegmentation def main(): train_image_fns = sorted(glob(os.path.join( 'dicom-images-train', '*/*...
[ "torch.no_grad", "torch.from_numpy", "torch.load", "torch.flip" ]
1.1.0
arc144/siim-pneumothorax
98fdb1fe08e9c001e0191d5024ba6c56ec82a9c8
1.7
import torch from scipy.spatial.distance import cosine from transformers import BertModel, BertTokenizer import os class SentenceSimilarity: def __init__(self, model_path='bert-base-uncased'): self.tokenizer = BertTokenizer.from_pretrained(model_path) self.model = BertModel.from_pretrained(model_...
[ "torch.device", "torch.no_grad", "torch.tensor" ]
1.7.1
lydia07/mdsearch
a328e822d6d66869aeefef687887b0a39d4f4512
1.2
import torch import torch.nn as nn from ..layers.convolutions import Convolutional, Separable_Conv_dila, Separable_Conv, Deformable_Convolutional import torch.nn.functional as F from ..layers.attention_blocks import SELayer class SPP(nn.Module): def __init__(self, depth=512): super(SPP,self).__init__() ...
[ "torch.cat", "torch.nn.Softmax", "torch.nn.MaxPool2d", "torch.nn.functional.interpolate", "torch.add", "torch.nn.Conv2d", "torch.nn.functional.softmax", "torch.nn.AdaptiveAvgPool2d", "torch.nn.functional.max_pool2d" ]
1.2.0
Shank2358/NPMMR-Det
869f3f537af9bc656f2bfdfa97ebb95bf70847a7
0.4
import argparse from random import choice import featureflow as ff import numpy as np from torch import nn from torch.nn import functional as F from torch.optim import Adam import zounds from zounds.learn import Conv1d, ConvTranspose1d, to_var, from_var from zounds.timeseries import categorical, inverse_categorical ...
[ "torch.nn.functional.leaky_relu" ]
0.4.1
FelixAbrahamsson/zounds
197c358acf3bea4252cfc2561da70cbe799e2c75
1.7
import numpy as np import os import json from PIL import Image import pickle import streamlit as st from streamlit.hashing import _CodeHasher from streamlit.report_thread import get_report_ctx from streamlit.server.server import Server import sys import urllib import torch import random import biggan from torchvision.u...
[ "torch.device", "torch.no_grad", "torch.tensor" ]
1.7.0
Praveenstein/bigGanMicro
d669874c0226907fa41b2140cdc8c46bdef2a283
1.9
import argparse from collections import defaultdict import torch from transformers import T5ForConditionalGeneration, T5Tokenizer from tqdm import tqdm from util.util_funcs import load_jsonl model = T5ForConditionalGeneration.from_pretrained("t5-small") tokenizer = T5Tokenizer.from_pretrained("t5-small") MNLI_TO_FEV...
[ "torch.squeeze" ]
1.9.0
Martin36/FEVER2021_SharedTask
4dd49e0ddf2909a93d44dab22eae988a067fc355
1.9
import os, sys import torch import argparse import shutil import pandas as pd from tqdm import tqdm from transformers import TapasTokenizer from data_processing.create_tapas_tables import create_tables from collections import defaultdict from util.util_funcs import load_jsonl, get_tables_from_docs, store_jsonl DIR_P...
[ "torch.device", "torch.gt", "torch.no_grad", "torch.cuda.is_available", "torch.tensor", "torch.load", "torch.reshape" ]
1.9.0
Martin36/FEVER2021_SharedTask
4dd49e0ddf2909a93d44dab22eae988a067fc355
1.8
# Copyright 2020 - 2021 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 wri...
[ "torch.cat", "torch.cuda.is_available", "torch.tensor", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss" ]
1.8
themantalope/MONAI
f398298b5aadc076102261a687a158f6ac17ad1c
1.6
import torch import torchvision.transforms as transforms import numpy as np import cv2 import logging from .model import Net class Extractor(object): def __init__(self, model_path, use_cuda=True): self.net = Net(reid=True) self.device = "cuda" if torch.cuda.is_available() and use_cuda else "cpu" ...
[ "torch.no_grad", "torch.cuda.is_available", "torch.load" ]
1.6.0
ruidongjr/Aldi
0d2dad1ab180abb59bee15d9e5e851e4de4e8cd5
1.3
import torch import torch.nn as nn import torch.nn.functional as F class VQALoss(nn.Module): def __init__(self, scale, loss_type='mixed', m=None): super(VQALoss, self).__init__() self.loss_type = loss_type self.scale = scale self.m = m # def forward(self, y_pred, y): r...
[ "torch.nn.functional.l1_loss", "torch.exp", "torch.mean" ]
1.3.0
lidq92/MDTVSFA
22f49a9c1b2faec4a643c92b0f6b69297f4e4121
1.3
# 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.nn.Linear", "torch.eq", "torch.load", "torch.cuda.device_count" ]
1.3
arnaudgelas/pytorch-lightning
cc624358c8e396e966f9c51b3010f6a986047fc6
1.7
import torch import numpy as np from src.trainers.base_trainer import BaseTrainer from src.evaluation.metrics import Metrics class LSTMAttnTrainer(BaseTrainer): """ Trainer class. Optimizer is by default handled by BaseTrainer. """ def __init__(self, model, config): super(LSTMAttnTrainer, s...
[ "torch.no_grad", "torch.max" ]
1.7.1
paxtonedgar/MisInfo
81b32fa3e7d0d204feb83e10169093f45727a2ea
1.8
import pytest import torch from torch.autograd import gradcheck import kornia import kornia.geometry.transform.imgwarp import kornia.testing as utils # test utils from kornia.testing import assert_close class TestAngleToRotationMatrix: def test_shape(self, device): inp = torch.ones(1, 3, 4, 4).to(device...
[ "torch.zeros", "torch.rand", "torch.autograd.gradcheck", "torch.inverse", "torch.ones", "torch.tensor", "torch.zeros_like", "torch.jit.script" ]
1.8.1
saurabhya/kornia
f2b4fe9fb32d99795783f25b5a4c561001783ebf
1.8
import hydra import torch import torch.nn as nn import torchvision import torchvision.transforms as T from hydra.core.config_store import ConfigStore from hydra.utils import to_absolute_path import kornia as K from kornia.x import Configuration, ImageClassifierTrainer, ModelCheckpoint cs = ConfigStore.instance() # Re...
[ "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader" ]
1.8.1
saurabhya/kornia
f2b4fe9fb32d99795783f25b5a4c561001783ebf
1.5
""" Transforms and data augmentation for sequence level images, bboxes and masks. Mostly copy-paste from https://github.com/Epiphqny/VisTR/blob/master/datasets/transforms.py """ import random import PIL import torch import torchvision.transforms as T import torchvision.transforms.functional as F from util.box_ops im...
[ "torch.all", "torch.tensor", "torch.as_tensor", "torch.nn.functional.pad" ]
1.5.0
anirudh-chakravarthy/PropTR
29448a0c73da6c9918d161228d92409d3d1315db
0.4
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: Donny You, RainbowSecret, JingyiXie ## Microsoft Research ## yuyua@microsoft.com ## Copyright (c) 2019 ## ## This source code is licensed under the MIT-style license found in the ## LICENSE file in the root directory of this sour...
[ "torch.utils.data.distributed.DistributedSampler" ]
0.4.1
tianweiy/openseg.pytorch
e4159e0b2db86d22149c44f220c5f2e3070a3042
1.10
""" From https://stackoverflow.com/questions/62265351/measuring-f1-score-for-multiclass-classification-natively-in-pytorch with this modification https://stackoverflow.com/questions/62265351/measuring-f1-score-for-multiclass-classification-natively-in-pytorch#comment122867942_63358412 """ from typing import Tuple impo...
[ "torch.zeros_like", "torch.div", "torch.eq", "torch.isnan" ]
1.10.2
Jakoviz/Infected-sweetpotato-classification
003befcc5c430f41f8426d9ac94894e20fdfc247
1.7
from torch.testing import assert_allclose from transformers import AutoModel from allennlp.common.testing import ModelTestCase from allennlp.data import Vocabulary from allennlp_models import vision # noqa: F401 from tests import FIXTURES_ROOT class TestVEVilbert(ModelTestCase): def test_model_can_train_save_...
[ "torch.testing.assert_allclose" ]
1.7.0
shunk031/allennlp-models
1e89d5e51cb45f3e77a48d4983bf980088334fac
1.7
""" BiMPM (Bilateral Multi-Perspective Matching) model implementation. """ from typing import Dict, List, Any import torch from allennlp.common.checks import check_dimensions_match from allennlp.data import TextFieldTensors, Vocabulary from allennlp.modules import FeedForward, Seq2SeqEncoder, Seq2VecEncoder, TextFi...
[ "torch.nn.Dropout", "torch.cat", "torch.nn.CrossEntropyLoss", "torch.nn.functional.softmax" ]
1.7.0
shunk031/allennlp-models
1e89d5e51cb45f3e77a48d4983bf980088334fac
1.8
from enum import auto from typing import Any, Callable, Dict, Optional import torch import torch.nn.functional as F from ..config.config import Config, ConfigEnum from ..data.labels import LabelType from ..utils.tensor import prepare_tensor from .quaternion import qconjugate, qmult MetricFunction = Callable[[torch....
[ "torch.cat", "torch.nn.functional.l1_loss", "torch.norm", "torch.FloatTensor", "torch.pow", "torch.nn.functional.mse_loss", "torch.mean", "torch.sum" ]
1.8.1
mhorn11/deepclr
6ee21963a402776851950a51709eef849ff96b5f
1.0
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import * import torch.nn.init as init import data from tools.logger import * from transf...
[ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.stack", "torch.arange", "torch.from_numpy", "torch.nn.Conv2d", "torch.Tensor", "torch.nn.Embedding" ]
1.0.0
KuNyaa/fastNLP
945b30bb6174751130744231aa26119bf9bb2601
1.0
import torch from torch import nn from fastNLP import seq_len_to_mask from fastNLP.modules import Embedding from fastNLP.modules import LSTM from fastNLP.modules import ConditionalRandomField, allowed_transitions import torch.nn.functional as F from fastNLP import Const class CNNBiLSTMCRF(nn.Module): def __init__...
[ "torch.nn.Dropout", "torch.cat", "torch.nn.init.constant_", "torch.nn.init.xavier_uniform_", "torch.nn.init.zeros_" ]
1.0.0
KuNyaa/fastNLP
945b30bb6174751130744231aa26119bf9bb2601
1.4
"""Test suites for numerical compatibility with librosa""" import os import unittest from distutils.version import StrictVersion import torch import torchaudio import torchaudio.functional as F from torchaudio._internal.module_utils import is_module_available LIBROSA_AVAILABLE = is_module_available('librosa') if LIB...
[ "torch.Size", "torch.rand", "torch.hann_window", "torch.linspace", "torch.from_numpy", "torch.random.manual_seed", "torch.abs", "torch.tensor", "torch.randn", "torch.dist" ]
1.4.0
adefossez/audio
19fc580da97baf179395bb257647c5c25b993e42
0.3
#!/usr/bin/env python3 import typing # noqa F401 import warnings import torch from torch import Tensor from ..exceptions.warnings import BadInitialCandidatesWarning def initialize_q_batch(X: Tensor, Y: Tensor, n: int, eta: float = 1.0) -> Tensor: r"""Heuristic for selecting initial conditions for candidate ge...
[ "torch.max", "torch.any", "torch.randperm", "torch.multinomial", "torch.exp" ]
0.3.2
cnheider/botorch
1d90aaff64b2f1e1f49bcac233b45ba18427f6fd
1.8
import cv2 import torch from Services.NeuralNetwork.tool.torch_utils import do_detect from Services.NeuralNetwork.tool.darknet2pytorch import Darknet class NeuralNetwork: @staticmethod def isCudaAvailable() -> bool: return torch.cuda.is_available() @staticmethod def getAvailableCa...
[ "torch.no_grad", "torch.cuda.is_available", "torch.cuda.get_device_name", "torch.cuda.device_count" ]
1.8.1
shell-done/Spongo_IHM
3492c889b1d60cf50b4b2625b496fd6958309a8e
3
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. """ This module implements loading meshes from glTF 2 assets stored in a GLB container file or a glTF J...
[ "torch.FloatTensor", "torch.from_numpy" ]
3
theycallmepeter/pytorch3d_PBR
bc83c23969ff7843fc05d2da001952b368926174
3
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import torch from pytorch3d import _C def sample_pdf( bins: torch.Tensor, weights: torch....
[ "torch.rand", "torch.stack", "torch.gather", "torch.linspace", "torch.zeros_like", "torch.searchsorted", "torch.ones_like", "torch.is_grad_enabled", "torch.cumsum" ]
3
theycallmepeter/pytorch3d_PBR
bc83c23969ff7843fc05d2da001952b368926174
3
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import unittest import torch from common_testing import TestCaseMixin from pytorch3d.loss import mesh_...
[ "torch.zeros", "torch.device", "torch.rand", "torch.cuda.synchronize", "torch.randint", "torch.tensor" ]
3
theycallmepeter/pytorch3d_PBR
bc83c23969ff7843fc05d2da001952b368926174
0.4
from __future__ import absolute_import, division, print_function import torch import pyro import pyro.distributions as dist import pyro.poutine as poutine from pyro.infer import EmpiricalMarginal, TracePredictive from pyro.infer.mcmc import MCMC, NUTS from tests.common import assert_equal def model(num_trials): ...
[ "torch.ones" ]
0.4.0
neerajprad/pyro
3b5b2c5de208209365bf26f239f12521de68acc4
1.4
#!/usr/bin/env python3 # 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 warnings from unittest import mock import torch from botorch import settings from botorch.acquisition.monte_car...
[ "torch.zeros", "torch.rand", "torch.Size", "torch.tensor", "torch.equal" ]
1.4
dme65/botorch
508f215bfe987373924e39444c8fb544d5132178
0.4
import torch import torch.nn as nn import torch.nn.parallel from torch.autograd import Variable from torchvision import models import torch.utils.model_zoo as model_zoo import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from miscc.config import cfg from GlobalAtte...
[ "torch.nn.Linear", "torch.cat", "torch.nn.LSTM", "torch.nn.GRU", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.utils.model_zoo.load_url", "torch.nn.utils.rnn.pack_padded_sequence", "torch.cuda.FloatTensor", "torch.Size", "torch.sigmoid", "torch.nn.functional.avg_pool2d", "torch.autogr...
0.4.1
niwtr/VQA-GAN
61275bf7e5b3f37fd8fbc0ec9ce4e0045343e299
1.0
""" This file is for models creation, which consults options and creates each encoder and decoder accordingly. """ import re import torch import torch.nn as nn from torch.nn.init import xavier_uniform_ import onmt.inputters as inputters import onmt.modules from onmt.encoders.rnn_encoder import RNNEncoder from onmt.enc...
[ "torch.nn.LogSoftmax", "torch.device", "torch.nn.init.xavier_uniform_", "torch.load" ]
1.0
miyamotost/ITDD-with-DialogueAct
827b8b27bacb8a48fea479e709c39eaee3610552
1.0
""" Optimizers class """ import torch import torch.optim as optim from torch.nn.utils import clip_grad_norm_ from onmt.utils import use_gpu import operator import functools from copy import copy from math import sqrt def build_optim(model, opt, checkpoint): """ Build optimizer """ saved_optimizer_state_dict =...
[ "torch.zeros", "torch.mul", "torch.max", "torch.is_tensor", "torch.nn.utils.clip_grad_norm_", "torch.div", "torch.sum" ]
1.0
miyamotost/ITDD-with-DialogueAct
e2267a2351a57be344e3de2ecf2f0d6820bc0cf9
1.4
import numpy as np import torch from torch import Tensor from PIL import Image, ImageEnhance def torch_none(x: Tensor): return x def torch_rot90_(x: Tensor): return x.transpose_(2, 3).flip(2) def torch_rot90(x: Tensor): return x.transpose(2, 3).flip(2) def torch_rot180(x: Tensor): return x.flip...
[ "torch.nn.functional.pad" ]
1.4.0
PKSingh0017/MSCG-Net
b7e79d68f14984fe460eff72bcbb8049e4d2bc9f
1.8
import copy import numpy import string import time import torch import tqdm from draugr.numpy_utilities import Split from draugr.python_utilities import ( rgb_drop_alpha_batch_nhwc, torch_vision_normalize_batch_nchw, ) from draugr.torch_utilities import ( TorchEvalSession, TorchTrainSession, global_...
[ "torch.max", "torch.no_grad", "torch.sum", "torch.dist", "torch.autograd.detect_anomaly" ]
1.8.1
aivclab/vision
6c644dd72f68bca608a2900e5d9461e90fe841eb
1.8
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "Christian Heider Nielsen" __doc__ = r""" Created on 22/03/2020 """ """Credit: mostly based on Ilya's excellent implementation here: https://github.com/ikostrikov/pytorch-flows""" import numpy import torch from torch import nn from tor...
[ "torch.nn.Linear", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.ones", "torch.nn.ReLU", "torch.nn.functional.linear", "torch.nn.LogSigmoid", "torch.zeros_like" ]
1.8.1
aivclab/vision
6c644dd72f68bca608a2900e5d9461e90fe841eb
1.8
import logging import numpy import os import random import shutil import time import torch from draugr import AverageMeter, find_unclaimed_port from draugr.numpy_utilities import Split from draugr.torch_utilities import TensorBoardPytorchWriter from pathlib import Path from torch import distributed, multiprocessing, nn...
[ "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "torch.distributed.init_process_group", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.no_grad", "torch.multiprocessing.spawn", "torch.optim.lr_scheduler.MultiStepLR", "torch.manual_seed", "torch.cuda.set_device", "torch.utils.data.Data...
1.8.1
aivclab/vision
6c644dd72f68bca608a2900e5d9461e90fe841eb
1.8
import logging import torch import torch.utils.data from pathlib import Path from torch.nn import Module from torch.utils.data import DataLoader from tqdm import tqdm from typing import Any, List from warg import NOD from neodroidvision import PROJECT_APP_PATH from neodroidvision.data.detection.coco import COCODataset...
[ "torch.device", "torch.no_grad", "torch.save", "torch.load" ]
1.8.1
aivclab/vision
6c644dd72f68bca608a2900e5d9461e90fe841eb
1.5
import torch.nn as nn class StyleClassifier(nn.Module): # classifies NPI outputs def __init__(self, n=200, m=768, k=1): """ input_activs_shape: tuple of (b, n, m, 1) b is the number of batches n x m x 1 slices contain the elements of the original activations, flattened into...
[ "torch.nn.Linear", "torch.nn.Sigmoid", "torch.nn.ReLU" ]
1.5.1
NancyFulda/towards-neural-programming-interfaces
21b467af56848c4fc8642fb0412f9f8d1b7718a2
1.4
''' fast scnn author: zacario li date: 2020-03-27 ''' import time import os import torch import torch.nn as nn import torch.nn.functional as F class FastSCNN(nn.Module): def __init__(self, numClasses, aux=False, **kwargs): super(FastSCNN, self).__init__() # auxiliary, use to accelarate the conver...
[ "torch.cat", "torch.nn.Dropout", "torch.nn.Sequential", "torch.nn.functional.interpolate", "torch.no_grad", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d", "torch.randn" ]
1.4.0
zacario-li/Fast-SCNN_pytorch
c7ff081e3ed626fcf7fc752696a38431f9a00942
1.8
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence from .fc_encoder import FcEncoder class BiLSTMEncoder(nn.Module): def __init__(self, input_size, hidden_size): super(BiLSTMEncoder, self).__init__() ...
[ "torch.nn.Linear", "torch.rand", "torch.cat", "torch.nn.LayerNorm", "torch.nn.LSTM", "torch.nn.Conv1d", "torch.nn.Sigmoid", "torch.bmm", "torch.nn.ReLU", "torch.nn.functional.softmax", "torch.Tensor", "torch.sum" ]
1.8.0
AIM3-RUC/ABAW2022
f1d25dc9914cc6768e58c14cea893c8e00b541bd
1.1
# Copyright 2020 The Forte Authors. 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 applicable ...
[ "torch.no_grad", "torch.cuda.is_available" ]
1.1.0
jzpang/forte
489fb9cafba6faf5739bda935836b61b5e3d02b6
1.8
import torch # from torch.autograd import Variable import torch.nn as nn import math import numpy as np import torch.nn.functional as F from torch.nn.utils.weight_norm import WeightNorm from Batchtransfer_EMA import BatchInstanceTransNorm as BIT2d def init_layer(L): # Initialization using fan-in if isinstance(...
[ "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ]
1.8.1
MosyMosy/VDT
e07f28d0cd6367ed30740c147ed2f270ead8fb63
1.8
# -*- coding: utf-8 -*- # @Time : 2021/5/29 # @Author : Lart Pang # @GitHub : https://github.com/lartpang from functools import partial from torch.utils import data from utils import builder, misc def get_tr_loader(cfg, shuffle=True, drop_last=True, pin_memory=True): dataset = builder.build_obj_from_regis...
[ "torch.utils.data.distributed.DistributedSampler" ]
1.8.1
lartpang/ZoomNet
1f329e80db5469eaf6a513ec384cd19bafdaece2
1.0
""" Contains classes for the comparison of models on the MNIST dataset. Main models: - MLPNet: Feed forward NN with linear layers - SPNNet: Same as MLPNet but replaces certain layers with SPNLayer - SPNNeuron: Defines the SPN architecture of a single neuron in a SPNLayer """ import logging import time import numpy as ...
[ "torch.nn.Linear", "torch.device", "torch.rand", "torch.stack", "torch.nn.ModuleList", "torch.nn.init.kaiming_normal_", "torch.logsumexp", "torch.ones", "torch.nn.BatchNorm1d", "torch.nn.init.xavier_normal_" ]
1.0.1
cvoelcker/spn-pytorch-experiments
495d1fddf00f76fe28e926f7e558b26089e5428e
1.0
import logging import time from src.utils.utils import time_delta_now import numpy as np import torch from torch import nn from torch.nn import functional as F logger = logging.getLogger(__name__) class Sum(nn.Module): def __init__(self, in_channels, in_features, out_channels, dropout=0.0): super(Sum, s...
[ "torch.rand", "torch.stack", "torch.split", "torch.logsumexp", "torch.nn.Parameter", "torch.distributions.Bernoulli", "torch.nn.functional.log_softmax", "torch.nn.functional.pad", "torch.randn", "torch.sum" ]
1.0.1
cvoelcker/spn-pytorch-experiments
495d1fddf00f76fe28e926f7e558b26089e5428e
1.0
import logging import os import numpy as np import torch from torch import optim from src.utils.utils import count_params from src.data.data import store_results from src.data.data_loader import get_mnist_loaders from src.models.mnist import evaluate_model, train from src.models.models import get_model_by_tag logger...
[ "torch.manual_seed", "torch.cuda.is_available", "torch.optim.lr_scheduler.StepLR" ]
1.0.1
cvoelcker/spn-pytorch-experiments
495d1fddf00f76fe28e926f7e558b26089e5428e
1.6
import torch from layers import Conv2d, Linear class ConvModel(torch.nn.Module): def __init__(self, in_channels: int, out_channels: int, dropout: bool = True): super().__init__() self.features = torch.nn.Sequential( Conv2d(in_channels, 32, 3, padding=1), torch.nn.ReLU(), ...
[ "torch.nn.ReLU", "torch.nn.Dropout", "torch.nn.MaxPool2d" ]
1.6.0
RobertCsordas/modules
efdb8790b074862581e035c9ab5bf889440a8023
1.6
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
[ "torch.cuda.is_available" ]
1.6.0
Magnety/tuFramework
b31cb34d476ef306b52da955021f93c91c14ddf4
1.4
import math import numbers import torch from torch import nn from torch.nn import functional as F class GaussianSmoothing(nn.Module): """ Apply gaussian smoothing on a 1d, 2d or 3d tensor. Filtering is performed seperately for each channel in the input using a depthwise convolution. Arguments: ...
[ "torch.exp", "torch.arange", "torch.sum" ]
1.4.0
PaulCzaban/Time-Travel-Rephotography.github.io
5d0ce32a48dfd7156a0f8dfddf0eadbb55b0be52
1.6
# %% Load packages import numpy as np import torch from sklearn.metrics import accuracy_score from bnn_mcmc_examples.examples.mlp.hawks.constants import num_chains from bnn_mcmc_examples.examples.mlp.hawks.dataloaders import test_dataloader from bnn_mcmc_examples.examples.mlp.hawks.prior.constants import sampler_out...
[ "torch.argmax" ]
1.6.0
papamarkou/bnn_mcmc_examples
297cdb1e74335860989bebdb4ff6f6322b6adc06
1.8
import os from typing import Any, Dict, Optional from unittest import mock import pytest import torch from pytorch_lightning import Trainer from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.plugins import FullyShardedNativeMixedPrecisionPlugin from pytorch_lightning.strategies import DDPF...
[ "torch.nn.Linear", "torch.nn.ReLU" ]
1.8
mathemusician/pytorch-lightning
15fa5389387b3a220bc044dd30eb0be1e8f64944
1.8
# 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.cuda.reset_peak_memory_stats", "torch.cuda.synchronize", "torch.cuda.max_memory_allocated", "torch.all", "torch.equal" ]
1.8
mathemusician/pytorch-lightning
15fa5389387b3a220bc044dd30eb0be1e8f64944
1.6
#!/usr/bin/env python3 import warnings from functools import partial from typing import Any, Callable, Dict, List, Optional, Tuple, Union import captum._utils.common as common import torch from captum._utils.av import AV from captum.attr import LayerActivation from captum.influence._core.influence import DataInfluenc...
[ "torch.numel", "torch.cat", "torch.gather", "torch.norm", "torch.argsort", "torch.mm", "torch.utils.data.DataLoader", "torch.linalg.norm", "torch.Tensor", "torch.topk" ]
1.6
i-jones/captum
567ec6fc67ab85ce07d075b25428be22bb65e31b
1.6
#!/usr/bin/env python3 from typing import Any, Callable, Generic, List, Tuple, Type, Union, cast import torch import torch.nn.functional as F from captum._utils.common import ( _format_additional_forward_args, _format_tensor_into_tuples, _run_forward, _validate_target, ) from captum._utils.gradient imp...
[ "torch.nn.functional.interpolate", "torch.no_grad" ]
1.6
i-jones/captum
567ec6fc67ab85ce07d075b25428be22bb65e31b
1.7
import math from logging import getLogger from typing import Optional import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import weight_norm from libcity.model import loss from libcity.model.abstract_traffic_state_model import AbstractTrafficStateModel def remov...
[ "torch.nn.Linear", "torch.cat", "torch.nn.MultiheadAttention", "torch.reshape", "torch.sigmoid", "torch.nn.Conv1d", "torch.tensor", "torch.nn.functional.relu", "torch.Tensor", "torch.device", "torch.nn.Sequential", "torch.nn.functional.dropout", "torch.mm", "torch.nn.ReLU", "torch.nn.Dro...
1.7.1
moghadas76/test_bigcity
607b9602c5b1113b23e1830455e174b0901d7558
1.7
from libcity.data import get_dataset from libcity.utils import get_logger, get_executor, get_model if __name__ == '__main__': config = { 'log_level': 'INFO', 'input_window': 12, 'output_window': 12, 'train_rate': 0.7, 'eval_rate': 0.1, 'cache_dataset': True, ...
[ "torch.cuda.is_available" ]
1.7.1
moghadas76/test_bigcity
607b9602c5b1113b23e1830455e174b0901d7558
1.5
import os from glob import glob from typing import Optional import cv2 import numpy as np import torch import yaml from fire import Fire from tqdm import tqdm from aug import get_normalize from models.networks import get_generator class Predictor: def __init__(self, weights_path: str, model_name: str = ''): ...
[ "torch.no_grad", "torch.from_numpy", "torch.load" ]
1.5.1
ZurMaD/DeblurGANv2
bf8ab7d178ecf32db7eba588ede3f3f121d17470
1.1
#!/usr/bin/env python3 """Script to check whether the installation is done correctly.""" # Copyright 2018 Nagoya University (Tomoki Hayashi) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import argparse import importlib import logging import sys import traceback from distutils.version import LooseVers...
[ "torch.cuda.is_available", "torch.backends.cudnn.is_available", "torch.cuda.device_count" ]
1.1.0
dertilo/espnet
4d2414b3d56154ab8c6ded0eb0a3f076e073344b
1.7
import glob import os import pretrainedmodels import torch from torch import nn from torchvision import models as torch_models import cifar_models as models from adversarial_defense.model.denoise_resnet import DenoiseResNet50, DenoiseResNet101, DenoiseResNet152 from adversarial_defense.model.pcl_resnet import Prototype...
[ "torch.nn.Linear", "torch.no_grad", "torch.FloatTensor", "torch.load" ]
1.7.1
machanic/TangentAttack
17c1a8e93f9bbd03e209e8650631af744a0ff6b8
1.1
# -*- coding: utf-8 -*- import sys sys.path.insert(0,"../../src2") import math import functools import time import torch import numpy as np from scipy.special import gamma import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import emcee from source_1d_likelihood_fn import compute_log_likelihood_2 ...
[ "torch.manual_seed", "torch.log" ]
1.1
DFNaiff/Dissertation
8db72a0e588042a582053625ec58cde6a661f2a9
1.1
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from ..functional import epipolar as E class PerspectiveTransformerLayer(nn.Module): def __init__(self, bv_size, pv_size, intrinsics, translate_z = -10.0, rotation_order='xyz', device='cuda:0', dtype=torch.float32): '''...
[ "torch.device", "torch.arange", "torch.inverse", "torch.tensor", "torch.ones_like", "torch.matmul" ]
1.1.0
huangyuyao/bevutils
24e5c4954b17ed58e27697447ab667c65f59b7e0