import torch


def _broadcast_if_scalar(x):
    """Return kwargs enabling broadcasting if 'x' is a scalar."""
    if isinstance(x, torch._C.Node):
        return {}
    else:
        return {"broadcast_i": 1}