yobx.torch.interpreter#

class yobx.torch.interpreter.TorchOpOverload[source]#

The class is unused only to bypass a documentation warning. The alias TorchOpOverload refers to torch._ops.Overload.

yobx.torch.interpreter.make_undefined_dimension(i: int) torch.SymInt[source]#

Uses for a custom op when a new dimension must be introduced to bypass some verification. The following function creates a dummy output with a dimension based on the content.

def symbolic_shape(x, y):
    return torch.empty(
        x.shape[0],
        make_undefined_dimension(min(x.shape[1], y[0])),
    )