1 # bendtorch: a PyTorch-like tensor library in Bend (F32 tensors, matmul, autograd tape, losses, SGD), with its laws and proofs; import one module, e.g. bendtorch-core@0.1.0.0/src/tensor/core.bend. 2 # Source, docs and license: https://github.com/aaaxn/bendtorch 3 # 4 # This file is the package entry. `bend bendtorch.bend --publish` ships it with 5 # everything it imports: the modules below, and PROOF.bend with every LAWS.bend. 6 # Import the module you need rather than this file: an import is local to the 7 # file that makes it, so this file's aliases are not visible to its importers, 8 # and importing it loads every proof. `bend bendtorch.bend --verdict` checks 9 # the laws of the whole package, as `bend PROOF.bend --verdict` does. 10 import Base 11 12 # Shapes and storage 13 import ./src/shape/core.bend as Shape 14 import ./src/storage/main.bend as Storage 15 16 # Tensors: construction, reads and writes, elementwise operations, reductions, 17 # matmul, layout transforms, PyTorch's signed axes, slicing and gathering 18 import ./src/tensor/core.bend as Core 19 import ./src/tensor/elementwise.bend as Elementwise 20 import ./src/tensor/reduction.bend as Reduction 21 import ./src/tensor/matmul.bend as Matmul 22 import ./src/tensor/batched_matmul.bend as Batched 23 import ./src/tensor/transforms.bend as Transforms 24 import ./src/tensor/layout.bend as Layout 25 import ./src/tensor/signed.bend as Signed 26 import ./src/tensor/slice.bend as Slice 27 import ./src/tensor/gather.bend as Gather 28 29 # Autograd: broadcasting and its sums back, gradient slots, the tape and its 30 # backward pass, the losses, SGD 31 import ./src/autograd/broadcast.bend as Broadcast 32 import ./src/autograd/reduce.bend as Reduce 33 import ./src/autograd/sum_to_size.bend as SumToSize 34 import ./src/autograd/sum_dims.bend as SumDims 35 import ./src/autograd/gradient.bend as Gradient 36 import ./src/autograd/backward.bend as ScalarBackward 37 import ./src/autograd/tensor_backward.bend as Backward 38 import ./src/autograd/loss.bend as Loss 39 import ./src/autograd/sgd.bend as Sgd 40 41 # Laws and their proofs 42 import ./PROOF.bend as Proof