# tensorplay.compiler.api.compile

Source: https://www.tensorplay.cn/docs/generated/tensorplay.compiler.api.compile.html

# tensorplay.compiler.api.compile

tensorplay.compiler.api.compile(model: [Callable](https://docs.python.org/3/library/typing.html#typing.Callable)[[...], [Any](https://docs.python.org/3/library/typing.html#typing.Any)] | [None](https://docs.python.org/3/library/constants.html#None) = None, *, fullgraph: [bool](https://docs.python.org/3/library/functions.html#bool) = False, dynamic: [bool](https://docs.python.org/3/library/functions.html#bool) | [None](https://docs.python.org/3/library/constants.html#None) = None, backend: [str](https://docs.python.org/3/library/stdtypes.html#str) | [Callable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable)[[...], CompiledFn] | [None](https://docs.python.org/3/library/constants.html#None) = None, mode: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None) = None, options: [dict](https://docs.python.org/3/library/stdtypes.html#dict)[[str](https://docs.python.org/3/library/stdtypes.html#str), [Any](https://docs.python.org/3/library/typing.html#typing.Any)] | [None](https://docs.python.org/3/library/constants.html#None) = None, name: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None) = None, disable: [bool](https://docs.python.org/3/library/functions.html#bool) = False, recompile_limit: [int](https://docs.python.org/3/library/functions.html#int) | [None](https://docs.python.org/3/library/constants.html#None) = None, isolate_recompiles: [bool](https://docs.python.org/3/library/functions.html#bool) = False, strict_native: [bool](https://docs.python.org/3/library/functions.html#bool) = False, dynamic_shapes: [Any](https://docs.python.org/3/library/typing.html#typing.Any) | [None](https://docs.python.org/3/library/constants.html#None) = None) &#x2192; [Callable](https://docs.python.org/3/library/typing.html#typing.Callable)[[...], [Any](https://docs.python.org/3/library/typing.html#typing.Any)][[source]](../_modules/tensorplay/compiler/api.html#compile)

Compile a callable through the TensorPlay compiler frontend.

backend may be a registered name or a callable with the contract
backend(graph_module, example_inputs, **kwargs) -> callable.  The
frontend caches specializations by input metadata and falls back to the
original callable when a non-fullgraph capture cannot represent the
Python region.
