mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
1022443168
Test Plan: revert-hammer Differential Revision: D30279364 (https://github.com/pytorch/pytorch/commit/b0043072529b81276a69df29e00555333117646c) 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)
|