Skip to main content

function_space.is_shared

function_space.is_shared(leaf, /)

Whether an inputs leaf is shared by every example: a non-tensor or a 0-dim tensor.

The other leaves carry one entry per example along their leading axis.

Parameters

Name Type Description Default
leaf object A leaf of an inputs pytree. required

Returns

Name Type Description
bool Whether leaf is shared.