TensorBackwardLAWS.sole: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/tensor_backward_LAWS.bend as TensorBackwardLAWS Lines 107-118 of bendtorch-core@0.1.0.0/src/autograd/tensor_backward_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward_LAWS.bend&start_line=107&end_line=118 import Base import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as Backward # The only contribution of a VJP, when it sends exactly one. def sole(pass: Backward.Pass) -> Maybe<&1, Backward.Contribution>: Backward.Pass{saved, g, contributions} = pass match contributions: case Fail{error}: None{} case Done{Nil{}}: None{} case Done{Con{contribution, Nil{}}}: Some{contribution} case Done{Con{contribution, Con{other, rest}}}: None{} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=Contribution https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=Pass