compile_fn

ivy.compile_fn(func, dynamic=True, example_inputs=None, f=None)[source]

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

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

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

  • example_inputs (single input of 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