Skip to content

Commit

Permalink
chore: fix pcc
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrery committed Jan 23, 2024
1 parent 0824703 commit bdc9472
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/torch/test_compile_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,12 +1381,15 @@ def test_onnx_no_input():
torch_input = torch.randn(100, 28)

class SimplifiedNet(nn.Module):
"""Network with no input in the onnx graph."""

def __init__(self):
super().__init__()
self.fc1 = nn.Linear(28, 10)
self.threshold = torch.tensor(0.5, dtype=torch.float32)

def forward(self, x):
"""Forward pass."""
zeros = numpy.zeros_like(x)
x = x + zeros
x = (x > self.threshold).to(torch.float32)
Expand Down

0 comments on commit bdc9472

Please sign in to comment.