def St.plan_of
import bendtorch-load@1.3.0.0/main.bend as BendtorchLoadimport Base
457# data_offsets must be [begin, end] with end - begin the tensor's bytes
458def St.plan_of(+name: String, bf16: Bool, +start: W64, +n: U32, +width: U32, of: List<&2, W64>) -> Plan:
459 match of:
460 case Con{+b, Con{e, Nil{}}}:
461 St.plan_span(W64.eq(W64.add(b, W64.mul_small(W64.of(n), width)), e), name, bf16, W64.add(start, b), n)
462 case _:
463 PlanBad{"tensor " ++ name ++ ": data_offsets is not [begin, end]"}