src/tensor/clone_metadata_contract_LAWS.bend

bendtorch-core@0.1.0.0 · 21 lines · 3 definitions

1import Base
2import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
3import bendtorch-core@0.1.0.0/src/tensor/clone_metadata_records.bend as Records
4
5law clone_contract:
6  for +shape: Shape.Shape
7  for +fill: F32
8  Records.CloneContract<shape, fill>
9
10law clone_write:
11  for +shape: Shape.Shape
12  for +fill: F32
13  for +index: U32
14  for +value: F32
15  for inside: {Nat.is_lt(U32.to_nat(index), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool}
16  Records.CloneWrite<shape, fill, index, value>
17
18law metadata_contract:
19  for +shape: Shape.Shape
20  for +fill: F32
21  Records.MetadataContract<shape, fill>