We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a5bca6 commit 4377a56Copy full SHA for 4377a56
backends/cadence/utils/facto_util.py
@@ -344,14 +344,25 @@ def random_size_constraint(deps: object, r: int, d: int) -> int:
344
]
345
)
346
case "div.Tensor":
347
- tensor_constraints.extend(
348
- [
349
- cp.Value.Ne(lambda deps, dtype, struct: 0),
350
- cp.Value.Le(lambda deps, dtype, struct: 2**3),
351
- cp.Size.Le(lambda deps, r, d: 2**3),
352
- cp.Rank.Le(lambda deps: 2**2),
353
- ]
354
- )
+ if index == 1: # Only apply zero-prevention to divisor
+ tensor_constraints.extend(
+ [
+ cp.Value.Ne(
+ lambda deps, dtype, struct: 0
+ ), # Prevent division by zero
+ cp.Value.Le(lambda deps, dtype, struct: 2**3),
+ cp.Size.Le(lambda deps, r, d: 2**3),
355
+ cp.Rank.Le(lambda deps: 2**2),
356
+ ]
357
+ )
358
+ else:
359
360
361
362
363
364
365
366
case "pow.Tensor_Scalar":
367
tensor_constraints.extend(
368
[
0 commit comments