Skip to content

Commit c244dd7

Browse files
SS-JIAfacebook-github-bot
authored andcommitted
Fix vulkan delegate partial test
Summary: ## Context Previously the `test_vulkan_backend_partial` was written erroneously as a duplicate constant reference was present in the graph. This was not caught previously, but pytorch/pytorch#120664 added checks that now catch the error. This is a simple change to correct the badly written test. Reviewed By: manuelcandales Differential Revision: D54263601 fbshipit-source-id: fc915b0c918d0a158e2efa08c5e11cd3d5d77e57
1 parent 2fbd2c4 commit c244dd7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

backends/vulkan/test/test_vulkan_delegate.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,8 @@ class SimpleModel(torch.nn.Module):
241241
def __init__(self):
242242
super().__init__()
243243
self.linear = torch.nn.Linear(10, 10)
244-
self.offset_1 = self.weight = torch.rand(
245-
size=(2, 10), dtype=torch.float32
246-
)
247-
self.offset_2 = self.weight = torch.rand(
248-
size=(2, 10), dtype=torch.float32
249-
)
244+
self.offset_1 = torch.rand(size=(2, 10), dtype=torch.float32)
245+
self.offset_2 = torch.rand(size=(2, 10), dtype=torch.float32)
250246

251247
def forward(self, x):
252248
return self.linear(x + self.offset_1) - self.offset_2

0 commit comments

Comments
 (0)