Skip to content

Commit 41e7ffa

Browse files
authored
Fix unittests failures introduced from D69212362
Differential Revision: D69251115 Pull Request resolved: #8278
1 parent c82a7df commit 41e7ffa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

exir/emit/test/test_emit.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ def test_non_const_buffer_sizes(self) -> None:
856856
class Add(torch.nn.Module):
857857
def forward(self, x: torch.Tensor) -> torch.Tensor:
858858
b = 3 + 1
859-
return x + b
859+
return x + torch.tensor(b)
860860

861861
f = Add()
862862

@@ -1325,7 +1325,10 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
13251325

13261326
# Find the multiplication node in the graph that was emitted.
13271327
for node in program_mul.exported_program().graph.nodes:
1328-
if node.target == torch.ops.aten.mul.out:
1328+
if (
1329+
node.target == torch.ops.aten.mul.out
1330+
or node.target == torch.ops.aten.mul.Scalar_out
1331+
):
13291332
break
13301333
self.assertIsNotNone(node)
13311334

exir/program/test/test_program.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,6 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
292292
).exported_program()
293293
for node in ep.graph.nodes:
294294
self.assertNotEqual(node.op, "get_attr")
295-
self.assertEqual(
296-
len([node for node in ep.graph.nodes if node.op == "placeholder"]), 2
297-
)
298295

299296
def test_constraint_present_after_dce(self):
300297
import executorch.exir as exir

0 commit comments

Comments
 (0)