Skip to main content
Log in

Mojo function

custom

custom[name: StringLiteral](values: List[Symbol], out_type: Type) -> Symbol

Creates a node to execute a custom graph operation in the graph.

The custom op should be registered by annotating a function with the max.register.op decorator.

Parameters:

  • name (StringLiteral): The op name provided to max.register.op.

Args:

  • values (List[Symbol]): The op function's arguments.
  • out_type (Type): The op function's return type.

Returns:

A symbolic value representing the output of the op in the graph.

custom[name: StringLiteral](values: List[Symbol], out_types: List[Type]) -> List[Symbol]

Creates a node to execute a custom graph operation in the graph.

The custom op should be registered by annotating a function with the max.register.op decorator.

Parameters:

  • name (StringLiteral): The op name provided to max.register.op.

Args:

  • values (List[Symbol]): The op function's arguments.
  • out_types (List[Type]): The list of op function's return type.

Returns:

Symbolic values representing the outputs of the op in the graph. These correspond 1:1 with the types passed as out_types.