bendtorch.bend

bendtorch-core@0.1.0.0 · 42 lines · 0 definitions

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.
10import Base
11
12# Shapes and storage
13import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
14import bendtorch-core@0.1.0.0/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
18import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
19import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
20import bendtorch-core@0.1.0.0/src/tensor/reduction.bend as Reduction
21import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matmul
22import bendtorch-core@0.1.0.0/src/tensor/batched_matmul.bend as Batched
23import bendtorch-core@0.1.0.0/src/tensor/transforms.bend as Transforms
24import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
25import bendtorch-core@0.1.0.0/src/tensor/signed.bend as Signed
26import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice
27import bendtorch-core@0.1.0.0/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
31import bendtorch-core@0.1.0.0/src/autograd/broadcast.bend as Broadcast
32import bendtorch-core@0.1.0.0/src/autograd/reduce.bend as Reduce
33import bendtorch-core@0.1.0.0/src/autograd/sum_to_size.bend as SumToSize
34import bendtorch-core@0.1.0.0/src/autograd/sum_dims.bend as SumDims
35import bendtorch-core@0.1.0.0/src/autograd/gradient.bend as Gradient
36import bendtorch-core@0.1.0.0/src/autograd/backward.bend as ScalarBackward
37import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as Backward
38import bendtorch-core@0.1.0.0/src/autograd/loss.bend as Loss
39import bendtorch-core@0.1.0.0/src/autograd/sgd.bend as Sgd
40
41# Laws and their proofs
42import bendtorch-core@0.1.0.0/PROOF.bend as Proof