def start_cast

bendtorch-core@0.1.0.0 · src/tensor/contracts/pointwise_proof.bend:400

import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise_proof.bend as PointwiseProof
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/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed

400def start_cast(~O: Data, ~f: O -> F32 -> F32 -> F32, ~P: Data, ~ia: P -> Nat -> Nat, ~ib: P -> Nat -> Nat,
401  +fuel: Nat, +operation: O, +plan: P, +left: Shape.Shape, +left_fill: F32, +left_ops: List<&2, StorageLaws.Op>,
402  +right: Shape.Shape, +right_fill: F32, +right_ops: List<&2, StorageLaws.Op>, +shape: Shape.Shape,
403  -Q: (Core.Dynamic & Core.Dynamic) & Result<&2, &1, Core.Error, Core.Dynamic> -> Type,
404  start: Start(~O, ~f, ~P, ~ia, ~ib, fuel, operation, plan, left, left_fill, left_ops, right, right_fill, right_ops, shape, 0n, Q)) ->
405  Shaped(~O, ~f, ~P, ~ia, ~ib, fuel, operation, plan, left, right, shape, 0n,
406    Replayed.storage(left, left_fill, left_ops), Replayed.storage(right, right_fill, right_ops), Replayed.storage(shape, 0.0, Nil{}), Q):
407  %Equal.cong(List<&2, StorageLaws.Op>, Storage.Storage, ops => Replayed.storage(left, left_fill, ops),
408    List.append(&2, StorageLaws.Op, left_ops, Nil{}), left_ops, append_nil(left_ops)) :
409    Shaped(~O, ~f, ~P, ~ia, ~ib, fuel, operation, plan, left, right, shape, 0n,
410      _, Replayed.storage(right, right_fill, right_ops), Replayed.storage(shape, 0.0, Nil{}), Q)
411  %Equal.cong(List<&2, StorageLaws.Op>, Storage.Storage, ops => Replayed.storage(right, right_fill, ops),
412    List.append(&2, StorageLaws.Op, right_ops, Nil{}), right_ops, append_nil(right_ops)) :
413    Shaped(~O, ~f, ~P, ~ia, ~ib, fuel, operation, plan, left, right, shape, 0n,
414      input_storage(~P, ~ia, plan, left, left_fill, left_ops, 0n), _, Replayed.storage(shape, 0.0, Nil{}), Q)
415  start

Uses (17)

Used by (1)