TorchLean API

NN.Backend.Reference

Reference and Portable Backend Capsules #

Portable capsules for paths that do not require CUDA or LibTorch.

These are not meant to win benchmarks. They keep TorchLean runnable on CPU-only machines and give the planner a clear fallback vocabulary for reference/spec-aligned execution.

def NN.Backend.Reference.referenceCapsule (name : String) (op : BackendOp) (specName valueSummary vjpSummary : String) (vjpMode : VJPMode := VJPMode.torchLeanTape) :
Instances For

    Reference ReLU activation.

    Instances For

      Reference GELU activation.

      Instances For

        Reference softmax path.

        Instances For

          Reference matmul path.

          Instances For

            Reference batched matrix multiplication.

            Instances For

              Reference linear layer.

              Instances For

                Reference mean-squared-error loss.

                Instances For

                  Reference layer normalization.

                  Instances For

                    Reference batch normalization.

                    Instances For

                      Reference channel-first BatchNorm runtime op.

                      Instances For

                        Reference generic channel-first convolution.

                        Instances For

                          Reference 2D convolution.

                          Instances For

                            Reference generic channel-first transpose convolution.

                            Instances For

                              Reference 2D transpose convolution.

                              Instances For

                                Reference max pooling.

                                Instances For

                                  Reference 2D max pooling.

                                  Instances For

                                    Reference padded 2D max pooling.

                                    Instances For

                                      Reference smooth max pooling.

                                      Instances For

                                        Reference smooth 2D max pooling.

                                        Instances For

                                          Reference average pooling.

                                          Instances For

                                            Reference 2D average pooling.

                                            Instances For

                                              Reference padded 2D average pooling.

                                              Instances For

                                                Reference attention path using the composed TorchLean expression.

                                                Instances For

                                                  Cross-platform reference capsules.

                                                  Instances For