xlnstorch.autograd.has_fanout

Contents

xlnstorch.autograd.has_fanout#

xlnstorch.autograd.has_fanout(root)#

Determines if the autograd graph starting from root has any fan-out nodes.

Parameters:

root (Union[torch.Tensor, torch.autograd.Function]) – A tensor whose .grad_fn is used as the graph root, or a Function node itself.

Returns:

True if there are nodes in the graph that have more than one parent, False otherwise.

Return type:

bool