backend.utils
Utility functions for working with different backends.
To add support for a new backend, add a conversion function to the CONVERTERS list.
Kramer Harrison, 2024
Functions
|
Checks if an object is a PyTorch tensor. |
|
Converts input scalar or array to NumPy array, regardless of backend. |
|
- is_torch_tensor(obj) bool[source]
Checks if an object is a PyTorch tensor.
- Parameters:
obj – The object to check.
- Returns:
True if the object is a PyTorch tensor, False otherwise.
- Return type:
bool