@@ -347,7 +347,9 @@ def random_size_constraint(deps: object, r: int, d: int) -> int:
347347 if index == 1 : # Only apply zero-prevention to divisor
348348 tensor_constraints .extend (
349349 [
350- cp .Value .Ne (lambda deps , dtype , struct : 0 ), # Prevent division by zero
350+ cp .Value .Ne (
351+ lambda deps , dtype , struct : 0
352+ ), # Prevent division by zero
351353 cp .Value .Le (lambda deps , dtype , struct : 2 ** 3 ),
352354 cp .Size .Le (lambda deps , r , d : 2 ** 3 ),
353355 cp .Rank .Le (lambda deps : 2 ** 2 ),
@@ -382,7 +384,9 @@ def random_size_constraint(deps: object, r: int, d: int) -> int:
382384 cp .Dtype .In (lambda deps : [torch .int64 , torch .int32 , torch .float32 ]),
383385 cp .Value .Ge (lambda deps , dtype , struct : - (2 ** 4 )),
384386 cp .Value .Le (lambda deps , dtype , struct : 2 ** 4 ),
385- cp .Value .Ne (lambda deps , dtype , struct : 0 ), # Prevent division by zero
387+ cp .Value .Ne (
388+ lambda deps , dtype , struct : 0
389+ ), # Prevent division by zero
386390 cp .Rank .Ge (lambda deps : 1 ),
387391 cp .Rank .Eq (lambda deps : deps [0 ].dim ()),
388392 cp .Size .Eq (lambda deps , r , d : fn .safe_size (deps [0 ], d )),
0 commit comments