tf_wrapper

class coffea.ml_tools.tf_wrapper(tf_model: str)[source]

Bases: nonserializable_attribute, numpy_call_wrapper

Wrapper for running tensorflow inference with awkward/dask-awkward inputs.

Methods Summary

numpy_call(*args, **kwargs)

Evaluating the numpy inputs via the model.__call__ method.

validate_numpy_input(*args, **kwargs)

Here we are assuming that the model contains the required information for parsing the input numpy array(s), and that the input numpy array(s) is the first argument of the user method call.

Methods Documentation

numpy_call(*args: array, **kwargs: array) array[source]

Evaluating the numpy inputs via the model.__call__ method. With a trivial conversion for tensors for the numpy inputs.

TODO: Do we need to evaluate using predict [1]? Since array batching is already handled by dask.

[1] https://keras.io/getting_started/faq/#whats-the-difference-between-model-methods-predict-and-call

validate_numpy_input(*args: array, **kwargs: array) None[source]

Here we are assuming that the model contains the required information for parsing the input numpy array(s), and that the input numpy array(s) is the first argument of the user method call.