def status_is_length
bendtorch-core@0.1.0.0 · src/tensor/construction_metadata.bend:16
import bendtorch-core@0.1.0.0/src/tensor/construction_metadata.bend as ConstructionMetadata
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/allocation_spec.bend as Allocation
16def status_is_length(-shape: Shape.Shape, result: Result<&2, &1, Core.Error, Core.Tensor<shape>>) ->
17 {Result.is_done(&2, &1, Core.Error, Core.Tensor<shape>, result) ==
18 Maybe.is_some(&2, Nat, Allocation.tensor_length(shape, result)) : Bool}:
19 match result:
20 case Fail{error}:
21 {==}
22 case Done{tensor}:
23 {==}