tensor_to_numpy: Tensor_to_numpy

View source: R/utils_python_data_management.R

tensor_to_numpyR Documentation

Tensor_to_numpy

Description

Function converts a tensor into a numpy array in order to allow further operations in R.

Usage

tensor_to_numpy(object)

Arguments

object

Object of any class.

Value

In the case the object is of class torch.Tensor it returns a numpy error. If the tensor requires a gradient and/or is on gpu it is detached and converted. If the object is not of class torch.Tensor the original object is returned.

See Also

Other Utils Python Data Management Developers: class_vector_to_py_dataset(), create_py_dataset_cache_file_path(), data.frame_to_py_dataset(), extract_column_from_py_dataset(), get_batches_index(), prepare_r_array_for_dataset(), py_dataset_to_embeddings(), reduce_to_unique(), tensor_list_to_numpy()


aifeducation documentation built on March 3, 2026, 1:06 a.m.