def first_dimension

bendtorch-core@0.1.0.0 · src/autograd/loss.bend:50

import bendtorch-core@0.1.0.0/src/autograd/loss.bend as Loss
import Base

50# The first dimension of [rows, columns] logits, the batch.
51def first_dimension(+dimensions: List<&2, U32>) -> Nat:
52  match dimensions:
53    case Nil{}:
54      0n
55    case Con{+first, +rest}:
56      U32.to_nat(first)

Uses (4)

Used by (1)