osl_dynamics.inference.ops.compiled#

osl_dynamics.inference.ops.compiled(func)#

func as a tf.function, compiled with XLA where it is supported.

This is done on first use rather than at import because checking the devices initializes them, after which devices.gpu_growth and devices.select_gpu no longer work.

Parameters:
funccallable

Function to compile.

Returns:
compiled_funccallable

The tf.function.