mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Test Plan: revert-hammer
Differential Revision:
D30279364 (b004307252)
Original commit changeset: c1ed77dfe43a
fbshipit-source-id: eab50857675c51e0088391af06ec0ecb14e2347e
10 lines
298 B
Python
10 lines
298 B
Python
import torch
|
|
class LinearMod(torch.nn.Linear):
|
|
def __init__(self, *args, **kwargs):
|
|
super().__init__(*args, **kwargs)
|
|
|
|
def forward(self, input):
|
|
return torch._C._nn.linear(input, self.weight, self.bias)
|
|
|
|
print(torch.jit.trace(LinearMod(20, 20), torch.rand([20, 20])).graph)
|