def product_empty

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

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

319def product_empty(+dims: List<&2, Nat>, length: {List.length(&2, Nat, dims) == 0n : Nat}) -> {Shape.numel(Axis.order(Nat, dims, Nil{})) == Shape.numel(dims) : Nat}:
320  match dims:
321    case Nil{}:
322      {==}
323    case +x0 <> +tail:
324      Empty.absurd({Shape.numel(Axis.order(Nat, x0 <> tail, Nil{})) == Shape.numel(x0 <> tail) : Nat}, nat_clash(1n+List.length(&2, Nat, tail), 0n, length, {==}))

Uses (7)

Used by (1)