def fit_empty

bendtorch-core@0.1.0.0 · src/tensor/axis_algebra.bend:326

import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as Axis

326def fit_empty(+dims: List<&2, Nat>, +coords: List<&2, Nat>, dl: {List.length(&2, Nat, dims) == 0n : Nat}, cl: {List.length(&2, Nat, coords) == 0n : Nat}) -> {Shape.fit(Axis.order(Nat, dims, Nil{}), Axis.order(Nat, coords, Nil{})) == Shape.fit(dims, coords) : Bool}:
327  match dims:
328    case Nil{}:
329      match coords:
330        case Nil{}:
331          {==}
332        case +c0 <> +ct:
333          Empty.absurd({Shape.fit(Axis.order(Nat, Nil{}, Nil{}), Axis.order(Nat, c0 <> ct, Nil{})) == Shape.fit(Nil{}, c0 <> ct) : Bool}, nat_clash(1n+List.length(&2, Nat, ct), 0n, cl, {==}))
334    case +d0 <> +dt:
335      Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> dt, Nil{}), Axis.order(Nat, coords, Nil{})) == Shape.fit(d0 <> dt, coords) : Bool}, nat_clash(1n+List.length(&2, Nat, dt), 0n, dl, {==}))

Uses (8)

Used by (1)