torch_wrapper
- class coffea.ml_tools.torch_wrapper(torch_jit: str)[source]
Bases:
nonserializable_attribute
,numpy_call_wrapper
Wrapper for running pytorch with awkward/dask-awkward inputs.
Methods Summary
numpy_call
(*args, **kwargs)Evaluating the numpy inputs via the model.
validate_numpy_input
(*args, **kwargs)Validating that the numpy-like input arguments are compatible with the underlying evaluation calls.
Methods Documentation
- numpy_call(*args: array, **kwargs: array) array [source]
Evaluating the numpy inputs via the model. Returning the results also as as numpy array.
- validate_numpy_input(*args: array, **kwargs: array) None [source]
Validating that the numpy-like input arguments are compatible with the underlying evaluation calls. This function should raise an exception if invalid input values are found. The base method performs no checks but raises a warning that no checks were performed.