law signed_inferred_indivisible

bendtorch-core@0.1.0.0 · src/tensor/signed_LAWS.bend:222

import bendtorch-core@0.1.0.0/src/tensor/signed_LAWS.bend as SignedLAWS
import Base
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signed

222# p > 0 that does not divide count: ElementCountMismatch, as PyTorch's
223# "shape is invalid for input of size".
224law signed_inferred_indivisible:
225  for +count: Nat
226  for +extents: List<&2, Signed.Extent>
227  for one: {Signed.inferred_count(extents) == 1n : Nat}
228  for +rest: Nat
229  for product: {Signed.exact_product(extents) == 1n+rest : Nat}
230  for +quotient: Nat
231  for +remainder: Nat
232  for split: {Nat.divmod(count, 1n+rest) == (quotient, 1n+remainder) : Nat & Nat}
233  {Signed.inferred_dimensions(count, extents) == Fail{Signed.TransformError{Transforms.LayoutError{Layout.ElementCountMismatch{}}}} :
234    Result<&2, &2, Signed.Error, List<&2, U32>>}

Uses (25)

Used by (0)

No other definition uses this definition.