def storage

bendtorch-core@0.1.0.0 · src/tensor/contracts/replayed.bend:12

import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed
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

12# A replayed tensor holds the storage that `Storage.new(count, fill)` creates,
13# changed by a list of storage operations in order. `Core.new(shape, fill)` is
14# the empty history, `Core.from_values` writes each value once, and every
15# contract-family output is a write history over a `+0.0` fill.
16def storage(+shape: Shape.Shape, +fill: F32, +ops: List<&2, StorageLaws.Op>) -> Storage.Storage:
17  StorageLaws.replay(ops, StorageLaws.created(Shape.count(shape), fill))

Uses (8)

Used by (134)