def filled
bendtorch-core@0.1.0.0 · src/tensor/batched_matmul.bend:301
import bendtorch-core@0.1.0.0/src/tensor/batched_matmul.bend as BatchedMatmul
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/storage/main.bend as Storage
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix
301
302
303
304def filled(+given: Layout, +output: Shape.Shape, +depth: Nat, +length: Nat,
305 -valid: {Storage.bounds(depth, length) == True{} : Bool},
306 -exact: {length == Shape.logical_numel(Shape.dimensions(output)) : Nat},
307 left: Core.Dynamic & Array<F32>, right: Core.Dynamic & Array<F32>) ->
308 Result<&2, &1, Core.Error, Core.Dynamic & Core.Dynamic & Core.Dynamic>:
309 (kept_left, la) = left
310 (kept_right, ra) = right
311 Done{(kept_left, kept_right, Core.pack(output, Core.TTensor{Storage.Owned{depth, length,
312 build(depth, Matrix.splits(depth, terms_of(given)), given, length, 0n, la, ra),
313 build_balanced(depth, Matrix.splits(depth, terms_of(given)), given, length, 0n, la, ra),
314 valid}, exact}))}