TensorVjpLAWS.first_of: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend as TensorVjpLAWS Lines 77-90 of bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_vjp_LAWS.bend&start_line=77&end_line=90 import Base import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as Backward # The two contributions of a VJP, when it sends exactly two. def first_of(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{first, Nil{}}}: None{} case Done{Con{first, Con{second, Nil{}}}}: Some{first} case Done{Con{first, Con{second, 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