compile_fn

ivy.compile_fn(func: Callable, dynamic: bool = True, example_inputs: Optional[Union[Any, Tuple[Any]]] = None, f: Optional[ivy.Framework] = None) → Callable[source]

Provide a function which should be compiled, for faster inference. The handle to the newly compiled function is returned.

Parameters
  • func (callable) – Function to be compiled.

  • dynamic (bool, default True) – Whether to compile all conditional branches, regardless of inputs during first invocation.

  • example_inputs (single input or tuple of inputs.) – Example of inputs to the function to be compiled. Required for torch in non-dynamic mode, unused by other frameworks.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.

Returns

The handle to the newly compiled function.


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty