Add aliases in nn.py

This commit is contained in:
Zheng-Ning Liu 2020-11-27 14:58:30 +08:00 committed by GitHub
parent e4c8ac5d77
commit d1975d9d7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -370,6 +370,8 @@ class BatchNorm(Module):
b = self.bias.broadcast(x, [0,2,3])
return norm_x * w + b
BatchNorm2d = BatchNorm
class BatchNorm1d(Module):
def __init__(self, num_features, eps=1e-5, momentum=0.1, affine=True, is_train=True, sync=True):
self.sync = sync
@ -584,6 +586,8 @@ class Conv(Module):
y = y + b
return y
Conv2d = Conv
class Conv1d(Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True):
self.in_channels = in_channels