lab.torch.custom.
as_torch
Convert object to PyTorch.
x (object) – Object to convert.
grad (bool, optional) – Requires gradient. Defaults to False.
x as a PyTorch object.
object
torch_register
Register a function and its sensitivity for PyTorch.
f (function) – Function to register.
s_f (function) – Sensitivity of f.
PyTorch primitive.
function