Args: out_channels: int, the channel of output, also is the number of filters bias: bool
(self, out_features, *args, bias=True, **kwargs)
| 292 | # TODO: replace current with |
| 293 | # def __init__(self, out_features, bias=True): |
| 294 | def __init__(self, out_features, *args, bias=True, **kwargs): |
| 295 | """ |
| 296 | Args: |
| 297 | out_channels: int, the channel of output, also is the number of |
| 298 | filters |
| 299 | bias: bool |
| 300 | """ |
| 301 | super(Linear, self).__init__() |
| 302 | |
| 303 | self.out_features = out_features |
| 304 | |
| 305 | # TODO: for backward compatibility, to remove |
| 306 | if len(args) > 0: |
| 307 | self.in_features = out_features |
| 308 | self.out_features = args[0] |
| 309 | if len(args) > 1: |
| 310 | self.bias = args[1] |
| 311 | else: |
| 312 | self.bias = bias |
| 313 | |
| 314 | def initialize(self, x): |
| 315 | self.in_features = x.shape[1] |