jactorch.utils.meta#
Functions
|
Move elements in a Python data structure to CPU. |
|
Move elements in a Python data structure to CPU. |
|
Detach elements in a Python data structure. |
|
Convert elements in a Python data structure to Python floating-point scalars. |
|
Convert elements in a Python data structure to numpy arrays. |
|
Convert elements in a Python data structure to tensors. |
|
DEPRECATED(Jiayuan Mao): as_variable has been deprecated and will be removed by 10/23/2018; please use as_tensor instead. |
|
DEPRECATED(Jiayuan Mao): mark_volatile has been deprecated and will be removed by 10/23/2018; please use torch.no_grad instead. |
Functions
- as_cpu(obj)[source]#
Move elements in a Python data structure to CPU. Only changes tensors and variables (PyTorch 0.x).
- as_cuda(obj)[source]#
Move elements in a Python data structure to CPU. Only changes tensors and variables (PyTorch 0.x).
- as_detached(obj, clone=False)[source]#
Detach elements in a Python data structure. Only changes tensors and variables (PyTorch 0.x).
- Parameters:
clone (bool) – if True, clone the tensor before detaching.
- as_float(obj)[source]#
Convert elements in a Python data structure to Python floating-point scalars. Supported types: tensor, variable (PyTorch 0.x), numpy array, and Python scalars.
- as_numpy(obj)[source]#
Convert elements in a Python data structure to numpy arrays. Supported types: tensor, variable (PyTorch 0.x), numpy array, and Python scalars.
- as_tensor(obj)[source]#
Convert elements in a Python data structure to tensors. Supported types: tensor, variable (PyTorch 0.x), numpy array, and Python scalars.