-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathautocomplete_code.txt
70 lines (56 loc) · 1.88 KB
/
autocomplete_code.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import numpy as np
import torch
import torch.nn as nn
from fairseq import utils
import torch.nn.functional as F
@utils.benchmark('time', timeout=5000)
@utils.parametrize('input_size', [1, 16, 256])
def test_transducer_forward_input(input_size):
x = torch.rand(input_size)
dec = torch.rand(input_size)
return x * decdef factorial(n):
pass
number = int(number * (number // 5))
actual = 0
for i in range(n):
factorial(i)
res = factorial(number // 2)
actual = res.sum().item()
assert actual == 100.from torch import nn
class LSTM(Module):
def __init__(self, *,
n_tokens: int,
embedding_size: int,
hidden_size: int,
n_layers: int):
pass
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch.nn as nn
import torch.nn.functional as F
from mmcv.utils import is_module_available, is_modules_available
from mmcv.utils import is_available
from mmcv.utils.cnn import get_list_from_list_modules
from mmcv.utils import normalize
from mmcv.cnn import filter_modules import filter_list_filter
from mmcv.utils.cnn.filter_from_modules
from mmcv.utils.ops import filter_by_params_from_list_list_from
class CNN(nn.Module):
def __init__(self):
super(CNN, self).__init__()
self.dense = nn.Linear(512, 50)
self.layer1 = nn.Linear(50, 10)
self.layer2 = nn.Linear(10, 10)
self.layer3 = nn.Linear(10, 10)
self.layer4 = nn.Linclass CNN(nn.Module):
def __init__(self,):
pass
# coding=utf-8
# 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 License.
# You may obtain a copy of the License at
#
#