File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,8 @@ def test_constraint_present_after_dce(self):
219
219
class M (torch .nn .Module ):
220
220
def forward (self , x , y ):
221
221
z = y .item ()
222
- torch ._constrain_as_value (z , 0 , 4 )
222
+ torch ._check (z > 0 )
223
+ torch ._check (z < 4 )
223
224
return x [z : z + y .shape [0 ]]
224
225
225
226
ep = torch .export .export (M (), (torch .randn (10 ), torch .tensor ([3 ])))
Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ def test_edge_verifier_enablement(self) -> None:
37
37
class M (torch .nn .Module ):
38
38
def forward (self , x , y ):
39
39
z = y .item ()
40
- torch ._constrain_as_value (z , 0 , 4 )
40
+ torch ._check (z > 0 )
41
+ torch ._check (z < 4 )
41
42
return x [z : z + y .shape [0 ]]
42
43
43
44
ep = torch .export .export (M (), (torch .randn (10 ), torch .tensor ([3 ])))
You can’t perform that action at this time.
0 commit comments