pytorch / 2 / generated / torch.autograd.graph.node.name.html

torch.autograd.graph.Node.name

abstract Node.name() [source]

Returns the name.

Example:

>>> import torch
>>> a = torch.tensor([0., 0., 0.], requires_grad=True)
>>> b = a.clone()
>>> assert isinstance(b.grad_fn, torch.autograd.graph.Node)
>>> print(b.grad_fn.name())
CloneBackward0
Return type

str

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.autograd.graph.Node.name.html