For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
register_shape_function
def register_shape_function(name: StringSpan[ImmStaticOrigin])
Registers a standalone shape function for a MAX Graph op.
The decorated function computes the output shapes of the named op on the
host, without executing the op itself. Tensor arguments must use tensor
traits: Some[Tensor] for shapes, Some[TileTensorable] for element values,
or TensorTuple for variadic inputs. ManagedTensorSlice and
VariadicTensors aliases are not accepted.
Args:
- name (
StringSpan[ImmStaticOrigin]): The name of the op whose output shapes the function computes.