def reshape_built

bendtorch-core@0.1.0.0 · src/tensor/transforms.bend:41

import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout

41def reshape_built(+input: Shape.Shape, tensor: Core.Tensor<input>, -dimensions: List<&2, U32>,
42  built: Shape.ConstructResult<dimensions>) -> Result<&2, &1, Error, Core.Dynamic>:
43  match built:
44    case Shape.SError{error}:
45      Fail{LayoutError{Layout.ShapeError{error}}}
46    case Shape.SBuilt{+target, preserved}:
47      reshape_decided(input, target, tensor,
48        Shape.bool_case(Nat.is_eq(Shape.elements(input), Shape.elements(target))))

Uses (13)

Used by (7)