TensorBackward.constant: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as TensorBackward Lines 1160-1166 of bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&start_line=1160&end_line=1166 import Base import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core # Records a constant: a leaf that takes no gradient, PyTorch's tensor with # requires_grad=False. No VJP sends it a contribution, so its slot reads None # after any backward that does not start at it; Sgd.step takes it as a leaf # and keeps it. def constant(tape: Tape, value: Core.Dynamic) -> Tape & Nat: Tape{entries} = tape pushed(Constant{}, value, Unsaved{}, counted(entries)) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=Saved https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=Tape https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=counted https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=pushed https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Dynamic