repo stringlengths 1 99 | file stringlengths 13 215 | code stringlengths 12 59.2M | file_length int64 12 59.2M | avg_line_length float64 3.82 1.48M | max_line_length int64 12 2.51M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
lxmert | lxmert-master/src/pretrain/lxmert_pretrain.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import collections
import os
import random
from tqdm import tqdm
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from param import args
from pretrain.lxmert_data import InputExample, LXMERTDataset, LXMERTTorchDataset, LXMERTEv... | 15,616 | 34.818807 | 110 | py |
lxmert | lxmert-master/src/lxrt/optimization.py | # coding=utf-8
# Copyright 2019 project LXRT
# Copyright 2018 The Google AI Language Team Authors and 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:/... | 7,927 | 42.801105 | 141 | py |
lxmert | lxmert-master/src/lxrt/entry.py | # coding=utf-8
# Copyright 2019 project LXRT.
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# 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 the ... | 5,278 | 32.624204 | 100 | py |
lxmert | lxmert-master/src/lxrt/modeling.py | # coding=utf-8
# Copyright 2019 project LXRT.
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# 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 the ... | 43,875 | 42.0579 | 136 | py |
lxmert | lxmert-master/src/lxrt/file_utils.py | """
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
import json
import logging
import os
import shutil
import tempfile
from functools import wraps
from hashlib import sha256
import sys
from i... | 8,209 | 32.104839 | 112 | py |
lxmert | lxmert-master/src/tasks/vqa_data.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import json
import os
import pickle
import numpy as np
import torch
from torch.utils.data import Dataset
from param import args
from utils import load_obj_tsv
# Load part of the dataset for fast checking.
# Notice that here is the number of images instead of the number o... | 5,757 | 29.465608 | 99 | py |
lxmert | lxmert-master/src/tasks/gqa_model.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import torch.nn as nn
from param import args
from lxrt.entry import LXRTEncoder
from lxrt.modeling import BertLayerNorm, GeLU
# Max length including <bos> and <eos>
MAX_GQA_LENGTH = 20
class GQAModel(nn.Module):
def __init__(self, num_answers):
super().__ini... | 1,224 | 25.630435 | 70 | py |
lxmert | lxmert-master/src/tasks/gqa_data.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import json
import numpy as np
import torch
from torch.utils.data import Dataset
from param import args
from utils import load_obj_tsv
# Load part of the dataset for fast checking.
# Notice that here is the number of images instead of the number of data,
# which means al... | 5,985 | 29.697436 | 119 | py |
lxmert | lxmert-master/src/tasks/vqa_model.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import torch.nn as nn
from param import args
from lxrt.entry import LXRTEncoder
from lxrt.modeling import BertLayerNorm, GeLU
# Max length including <bos> and <eos>
MAX_VQA_LENGTH = 20
class VQAModel(nn.Module):
def __init__(self, num_answers):
super().__ini... | 1,298 | 24.98 | 70 | py |
lxmert | lxmert-master/src/tasks/vqa.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import os
import collections
import torch
import torch.nn as nn
from torch.utils.data.dataloader import DataLoader
from tqdm import tqdm
from param import args
from pretrain.qa_answer_table import load_lxmert_qa
from tasks.vqa_model import VQAModel
from tasks.vqa_data imp... | 7,794 | 35.255814 | 98 | py |
lxmert | lxmert-master/src/tasks/nlvr2_data.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import json
import numpy as np
from torch.utils.data import Dataset
from param import args
from utils import load_obj_tsv
# Load part of the dataset for fast checking.
# Notice that here is the number of images instead of the number of data,
# which means all related dat... | 4,922 | 30.158228 | 110 | py |
lxmert | lxmert-master/src/tasks/nlvr2.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import os
import collections
from tqdm import tqdm
import torch
import torch.nn as nn
from torch.utils.data.dataloader import DataLoader
from param import args
from tasks.nlvr2_model import NLVR2Model
from tasks.nlvr2_data import NLVR2Dataset, NLVR2TorchDataset, NLVR2Eval... | 6,387 | 33.907104 | 98 | py |
lxmert | lxmert-master/src/tasks/nlvr2_model.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import torch.nn as nn
from lxrt.modeling import GeLU, BertLayerNorm
from lxrt.entry import LXRTEncoder
from param import args
class NLVR2Model(nn.Module):
def __init__(self):
super().__init__()
self.lxrt_encoder = LXRTEncoder(
args,
... | 1,773 | 30.678571 | 94 | py |
lxmert | lxmert-master/src/tasks/gqa.py | # coding=utf-8
# Copyleft 2019 project LXRT.
import os
import collections
import torch
from tqdm import tqdm
import torch.nn as nn
from torch.utils.data.dataloader import DataLoader
from param import args
from pretrain.qa_answer_table import load_lxmert_qa
from tasks.gqa_model import GQAModel
from tasks.gqa_data imp... | 7,680 | 35.402844 | 98 | py |
lxmert | lxmert-master/data/vg_gqa_imgfeat/extract_gqa_image.py | # !/usr/bin/env python
# The root of bottom-up-attention repo. Do not need to change if using provided docker file.
BUTD_ROOT = '/opt/butd/'
import os, sys
sys.path.insert(0, BUTD_ROOT + "/tools")
os.environ['GLOG_minloglevel'] = '2'
import _init_paths
from fast_rcnn.config import cfg, cfg_from_file, cfg_from_list
f... | 6,511 | 35.58427 | 113 | py |
lxmert | lxmert-master/data/nlvr2_imgfeat/extract_nlvr2_image.py | # !/usr/bin/env python
# The root of bottom-up-attention repo. Do not need to change if using provided docker file.
BUTD_ROOT = '/opt/butd/'
# SPLIT to its folder name under IMG_ROOT
SPLIT2DIR = {
'train': 'train',
'valid': 'dev',
'test': 'test1',
'hidden': 'test2', # Please correct w... | 7,358 | 35.430693 | 113 | py |
lxmert | lxmert-master/data/mscoco_imgfeat/extract_coco_image.py | # !/usr/bin/env python
# The root of bottom-up-attention repo. Do not need to change if using provided docker file.
BUTD_ROOT = '/opt/butd/'
# SPLIT to its folder name under IMG_ROOT
SPLIT2DIR = {
'train': 'train2014',
'valid': 'val2014',
'test': 'test2015',
}
import os, sys
sys.path.... | 6,810 | 35.42246 | 113 | py |
SupplementaryPaperRVCompare | SupplementaryPaperRVCompare-main/get_sample.py | """
Title: Simple MNIST convnet
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2015/06/19
Last modified: 2020/04/21
Description: A simple convnet that achieves ~99% test accuracy on MNIST.
"""
from tqdm import tqdm as tqdm
import os
import random
import numpy as np
import tensorflow as tf
from keras imp... | 4,170 | 23.827381 | 130 | py |
DGNet | DGNet-main/lib_pytorch/MyTest.py | import os
import torch
import argparse
import numpy as np
from scipy import misc
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
from torchvision.models.utils import load_state_dict_from_url
from utils.dataset import test_dataset as EvalDataset
from lib.DGNet import DGNet as Network
def evaluat... | 3,791 | 38.5 | 143 | py |
DGNet | DGNet-main/lib_pytorch/MyEval.py | import os
import torch
# import shutil
# import numpy as np
# from PIL import Image
# import torch.nn.functional as F
# import torch.backends.cudnn as cudnn
import eval.python.metrics as Measure
import prettytable as pt
# import sys
import argparse
import cv2
from tqdm import tqdm
def get_competitors(root):
for ... | 8,547 | 42.612245 | 248 | py |
DGNet | DGNet-main/lib_pytorch/MyTrain.py | # author: Daniel-Ji (e-mail: gepengai.ji@gmail.com)
# data: 2021-01-16
# torch libraries
import os
import logging
import numpy as np
from datetime import datetime
from tensorboardX import SummaryWriter
from lib.DGNet import DGNet as Network
import torch
import torch.nn.functional as F
import torch.backends.cudnn as cud... | 12,035 | 43.25 | 143 | py |
DGNet | DGNet-main/lib_pytorch/eval/python/metrics.py | # -*- coding: utf-8 -*-
# @Time : 2021/09/13
# @Author : Johnson-Chou
# @Email : johnson111788@gmail.com
# @FileName : metrics.py
# @Reference: https://github.com/lartpang/PySODMetrics and https://github.com/mczhuge/SOCToolbox
import torch
import numpy as np
import torch.nn as nn
from sklearn import metrics
f... | 17,419 | 34.050302 | 117 | py |
DGNet | DGNet-main/lib_pytorch/utils/zip_file.py | import zipfile
import os.path
import os
class ZFile(object):
# pip install zipfile36
def zip_file(fs_name, fz_name):
"""
从压缩文件
:param fs_name: 源文件名
:param fz_name: 压缩后文件名
:return:
"""
flag = False
if fs_name and fz_name:
try:
... | 2,053 | 35.035088 | 158 | py |
DGNet | DGNet-main/lib_pytorch/utils/dataset.py | import os
import random
import numpy as np
from PIL import Image, ImageEnhance
import torch.utils.data as data
import torchvision.transforms as transforms
def cv_random_flip(img, label, grad):
flip_flag = random.randint(0, 1)
if flip_flag == 1:
img = img.transpose(Image.FLIP_LEFT_RIGHT)
label... | 7,597 | 33.694064 | 120 | py |
DGNet | DGNet-main/lib_pytorch/utils/efficiency_eval.py | import torch
import time
import numpy as np
import jittor as jt
from ptflops import get_model_complexity_info
from lib_jittor.lib.DGNet import DGNet as jt_Network
from lib_pytorch.lib.DGNet import DGNet as py_Network
jt.flags.use_cuda = 1
bs = 16
test_img = np.random.random((bs,3,352,352)).astype('float32')
pytorch... | 2,345 | 36.238095 | 97 | py |
DGNet | DGNet-main/lib_pytorch/lib/PVTv2.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from torchvision.models.utils import load_state_dict_from_url
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from timm.models.registry import register_model
from timm.models.vision_transformer import _cfg... | 16,980 | 38.490698 | 129 | py |
DGNet | DGNet-main/lib_pytorch/lib/EfficientNet.py | """model.py - Model and module class for EfficientNet.
They are built to mirror those in the official TensorFlow implementation.
"""
# Author: lukemelas (github username)
# Github repo: https://github.com/lukemelas/EfficientNet-PyTorch
# With adjustments and added comments by workingcoder (github username).
import... | 19,546 | 40.678038 | 107 | py |
DGNet | DGNet-main/lib_pytorch/lib/utils.py | """utils.py - Helper functions for building the model and for loading model parameters.
These helper functions are built to mirror those in the official TensorFlow implementation.
"""
# Author: lukemelas (github username)
# Github repo: https://github.com/lukemelas/EfficientNet-PyTorch
# With adjustments and added ... | 24,961 | 39.45705 | 130 | py |
DGNet | DGNet-main/lib_pytorch/lib/DGNet.py | # torch libraries
import torch
import torch.nn as nn
# customized libraries
from .EfficientNet import EfficientNet
from .PVTv2 import pvt_v2_b0, pvt_v2_b1, pvt_v2_b2, pvt_v2_b3, pvt_v2_b4
class ConvBR(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, stride=1, padding=0, dilation=1):
su... | 8,412 | 37.949074 | 105 | py |
DGNet | DGNet-main/lib_jittor/lib/EfficientNet.py | import jittor as jt
from jittor import nn
from lib_jittor.lib.utils import round_filters, round_repeats, drop_connect, get_same_padding_conv2d, get_model_params, \
efficientnet_params, load_pretrained_weights, Swish, MemoryEfficientSwish, calculate_output_image_size
VALID_MODELS = (
'efficientnet-b0', 'effici... | 17,443 | 76.528889 | 1,184 | py |
DGNet | DGNet-main/lib_ascend/evaluation.py | import os
import torch
import eval.metrics as Measure
import prettytable as pt
import argparse
import cv2
from tqdm import tqdm
def get_competitors(root):
for model_name in os.listdir(root):
print('\'{}\''.format(model_name), end=', ')
def evaluator(gt_pth_lst, pred_pth_lst):
# define measures
F... | 7,581 | 41.357542 | 248 | py |
DGNet | DGNet-main/lib_ascend/inference_onnx.py | # Copyright(C) 2022. Huawei Technologies Co.,Ltd. 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 ap... | 2,070 | 34.101695 | 117 | py |
DGNet | DGNet-main/lib_ascend/torch_to_onnx.py | import sys
import torch
import torch.onnx
# import torchvision.models as models
from lib.DGNet import DGNet
def pth2onnx(model_type, input_file, output_file):
# 对于efficient模型的初始化
if model_type == 'DGNet':
model = DGNet(channel=64, arc='EfficientNet-B4', M=[8, 8, 8], N=[4, 8, 16])
model.context... | 2,326 | 37.783333 | 173 | py |
DGNet | DGNet-main/lib_ascend/eval/metrics.py | # -*- coding: utf-8 -*-
# @Time : 2021/09/13
# @Author : Johnson-Chou
# @Email : johnson111788@gmail.com
# @FileName : metrics.py
# @Reference: https://github.com/lartpang/PySODMetrics and https://github.com/mczhuge/SOCToolbox
import torch
import numpy as np
import torch.nn as nn
from sklearn import metrics
f... | 17,419 | 34.050302 | 117 | py |
DGNet | DGNet-main/lib_ascend/lib/PVTv2.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from torchvision.models.utils import load_state_dict_from_url
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from timm.models.registry import register_model
from timm.models.vision_transformer import _cfg... | 16,598 | 38.521429 | 129 | py |
DGNet | DGNet-main/lib_ascend/lib/EfficientNet.py | """model.py - Model and module class for EfficientNet.
They are built to mirror those in the official TensorFlow implementation.
"""
# Author: lukemelas (github username)
# Github repo: https://github.com/lukemelas/EfficientNet-PyTorch
# With adjustments and added comments by workingcoder (github username).
import... | 19,552 | 40.690832 | 107 | py |
DGNet | DGNet-main/lib_ascend/lib/utils.py | """utils.py - Helper functions for building the model and for loading model parameters.
These helper functions are built to mirror those in the official TensorFlow implementation.
"""
# Author: lukemelas (github username)
# Github repo: https://github.com/lukemelas/EfficientNet-PyTorch
# With adjustments and added ... | 24,957 | 39.450567 | 130 | py |
DGNet | DGNet-main/lib_ascend/lib/DGNet.py | # torch libraries
import torch
import torch.nn as nn
# customized libraries
from .EfficientNet import EfficientNet
from .PVTv2 import *
class ConvBR(nn.Module):
def __init__(self, in_channel, out_channel, kernel_size, stride=1, padding=0, dilation=1):
super(ConvBR, self).__init__()
self.conv = nn.... | 10,382 | 41.036437 | 105 | py |
tlp | tlp-main/tutorials/auto_scheduler/tune_network_x86.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 14,203 | 44.525641 | 101 | py |
tlp | tlp-main/tutorials/auto_scheduler/tune_network_cuda.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 14,279 | 44.623003 | 101 | py |
tlp | tlp-main/tutorials/auto_scheduler/tune_network_arm.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 18,112 | 41.921801 | 107 | py |
tlp | tlp-main/tutorials/auto_scheduler/tune_network_mali.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 16,463 | 44.355372 | 115 | py |
tlp | tlp-main/tutorials/frontend/deploy_model_on_android.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 12,032 | 31.787466 | 173 | py |
tlp | tlp-main/tutorials/frontend/from_onnx.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 5,731 | 41.776119 | 95 | py |
tlp | tlp-main/tutorials/frontend/deploy_ssd_gluoncv.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 4,354 | 31.992424 | 98 | py |
tlp | tlp-main/tutorials/frontend/deploy_prequantized.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 10,039 | 40.316872 | 93 | py |
tlp | tlp-main/tutorials/frontend/from_pytorch.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 5,559 | 31.138728 | 97 | py |
tlp | tlp-main/tutorials/frontend/deploy_object_detection_pytorch.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 4,950 | 30.941935 | 98 | py |
tlp | tlp-main/tutorials/frontend/from_tflite.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 6,325 | 31.777202 | 144 | py |
tlp | tlp-main/tutorials/frontend/from_mxnet.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 5,281 | 34.931973 | 99 | py |
tlp | tlp-main/tutorials/frontend/deploy_sparse.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 18,965 | 52.576271 | 319 | py |
tlp | tlp-main/tutorials/frontend/deploy_model_on_rasp.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 8,141 | 34.246753 | 116 | py |
tlp | tlp-main/tutorials/frontend/from_keras.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 4,692 | 34.824427 | 82 | py |
tlp | tlp-main/tutorials/frontend/from_coreml.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 4,111 | 34.756522 | 85 | py |
tlp | tlp-main/tutorials/frontend/deploy_quantized.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 6,151 | 36.060241 | 88 | py |
tlp | tlp-main/tutorials/frontend/from_caffe2.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 4,737 | 31.452055 | 86 | py |
tlp | tlp-main/tutorials/frontend/build_gcn.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 12,192 | 32.963788 | 156 | py |
tlp | tlp-main/tutorials/dev/bring_your_own_datatypes.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 17,539 | 41.572816 | 286 | py |
tlp | tlp-main/tutorials/dev/use_pass_infra.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 12,708 | 41.363333 | 102 | py |
tlp | tlp-main/tutorials/autotvm/tune_simple_template.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 13,701 | 39.658754 | 157 | py |
tlp | tlp-main/tutorials/autotvm/tune_relay_mobile_gpu.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 16,386 | 37.467136 | 100 | py |
tlp | tlp-main/tutorials/autotvm/tune_conv2d_cuda.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 9,872 | 39.297959 | 162 | py |
tlp | tlp-main/tutorials/autotvm/tune_relay_arm.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 16,121 | 37.569378 | 143 | py |
tlp | tlp-main/tutorials/autotvm/tune_relay_cuda.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 15,160 | 37.874359 | 135 | py |
tlp | tlp-main/tutorials/autotvm/tune_relay_x86.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 10,376 | 38.60687 | 100 | py |
tlp | tlp-main/apps/bundle_deploy/build_model.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 6,438 | 37.556886 | 101 | py |
tlp | tlp-main/apps/ios_rpc/tests/ios_rpc_mobilenet.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 6,046 | 32.782123 | 99 | py |
tlp | tlp-main/apps/android_camera/models/prepare_model.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 5,094 | 35.392857 | 94 | py |
tlp | tlp-main/apps/benchmark/util.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 3,448 | 32.813725 | 108 | py |
tlp | tlp-main/python/gen_requirements.py | #!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | 20,940 | 32.99513 | 244 | py |
tlp | tlp-main/python/tvm/relay/testing/densenet.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 5,020 | 34.609929 | 101 | py |
tlp | tlp-main/python/tvm/relay/testing/dcgan.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 5,241 | 29.300578 | 99 | py |
tlp | tlp-main/python/tvm/relay/testing/inception_v3.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 12,857 | 28.222727 | 97 | py |
tlp | tlp-main/python/tvm/relay/frontend/mxnet.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 111,766 | 37.237085 | 100 | py |
tlp | tlp-main/python/tvm/relay/frontend/mxnet_qnn_op_utils.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 16,342 | 35.643498 | 110 | py |
tlp | tlp-main/python/tvm/relay/frontend/keras.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 47,757 | 37.545601 | 100 | py |
tlp | tlp-main/python/tvm/relay/frontend/pytorch.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 120,472 | 35.69601 | 120 | py |
tlp | tlp-main/python/tvm/relay/frontend/onnx.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 113,560 | 35.03967 | 113 | py |
tlp | tlp-main/python/tvm/relay/frontend/coreml.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 22,238 | 35.637562 | 98 | py |
tlp | tlp-main/python/tvm/relay/frontend/common.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 20,058 | 31.043131 | 99 | py |
tlp | tlp-main/python/tvm/relay/frontend/qnn_torch.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32,913 | 33.82963 | 99 | py |
tlp | tlp-main/python/tvm/relay/frontend/__init__.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 1,328 | 36.971429 | 66 | py |
tlp | tlp-main/python/tvm/relay/frontend/caffe.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 30,442 | 35.990279 | 99 | py |
tlp | tlp-main/python/tvm/relay/frontend/caffe2.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 19,975 | 31.801314 | 108 | py |
tlp | tlp-main/python/tvm/relay/frontend/pytorch_utils.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 14,670 | 35.046683 | 95 | py |
tlp | tlp-main/python/tvm/relay/op/transform.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 49,075 | 29.126458 | 100 | py |
tlp | tlp-main/python/tvm/driver/tvmc/frontends.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 10,471 | 27 | 99 | py |
tlp | tlp-main/python/tvm/auto_scheduler/cost_model/mlp_model.py | from collections import OrderedDict
import copy
from itertools import chain
import multiprocessing
import os
import pickle
import random
import time
import io
import json
import numpy as np
import torch
import torch.nn.functional as F
import logging
logger = logging.getLogger("auto_scheduler")
from tvm.auto_scheduler... | 34,044 | 36.086057 | 124 | py |
tlp | tlp-main/python/tvm/auto_scheduler/cost_model/xgb_model.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 26,369 | 34.587045 | 104 | py |
tlp | tlp-main/python/tvm/auto_scheduler/cost_model/tlp_model.py | import pickle
import torch
import logging
from .cost_model import PythonBasedModel
from tvm.auto_scheduler.feature import get_per_store_features_from_states_tlp, get_per_store_features_from_states_tlp_init
logger = logging.getLogger("auto_scheduler")
class TLPModel(PythonBasedModel):
"""The wrapper of MLPModelI... | 1,296 | 30.634146 | 122 | py |
tlp | tlp-main/python/tvm/auto_scheduler/cost_model/tabnet_model.py | from collections import OrderedDict
import copy
from itertools import chain
import multiprocessing
import os
import pickle
import random
import time
import io
import json
import numpy as np
import torch
import torch.nn.functional as F
import logging
logger = logging.getLogger("auto_scheduler")
from tvm.auto_scheduler... | 45,558 | 35.301992 | 137 | py |
tlp | tlp-main/python/tvm/auto_scheduler/cost_model/sparsemax.py |
from torch import nn
from torch.autograd import Function
import torch.nn.functional as F
import torch
"""
Other possible implementations:
https://github.com/KrisKorrel/sparsemax-pytorch/blob/master/sparsemax.py
https://github.com/msobroza/SparsemaxPytorch/blob/master/mnist/sparsemax.py
https://github.com/vene/sparse... | 8,534 | 30.263736 | 100 | py |
tlp | tlp-main/python/tvm/contrib/mxnet.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 2,693 | 33.101266 | 92 | py |
tlp | tlp-main/python/tvm/contrib/dlpack.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 2,115 | 31.060606 | 93 | py |
tlp | tlp-main/python/tvm/topi/nn/depth_to_space.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 3,249 | 35.931818 | 88 | py |
tlp | tlp-main/python/tvm/autotvm/tuner/xgboost_cost_model.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 21,888 | 32.572086 | 98 | py |
tlp | tlp-main/python/tvm/autotvm/tuner/xgboost_tuner.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 4,153 | 37.82243 | 92 | py |
tlp | tlp-main/python/tvm/autotvm/tuner/__init__.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 1,232 | 38.774194 | 80 | py |
tlp | tlp-main/scripts/tlp_make_dataset_bert.py | import torch
import os
import glob
import json
import pickle
from random import random
from tvm import auto_scheduler
from common import (load_and_register_tasks, get_measure_record_filename, get_to_measure_filename)
import threading
import multiprocessing
from tvm.tir.expr import FloatImm
import numpy as np
import ran... | 8,995 | 32.819549 | 136 | py |
tlp | tlp-main/scripts/lightgbm_bayesian_hyperparameter_opt.py | """Train a cost model with a dataset."""
import argparse
import logging
import pickle
import random
import torch
import numpy as np
import tvm
from tvm.auto_scheduler.utils import to_str_round
from tvm.auto_scheduler.cost_model import RandomModelInternal
from common import load_and_register_tasks, str2bool
from tv... | 7,737 | 35.5 | 142 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.