tensor_list_to_numpy: Convert list of tensors into numpy arrays

View source: R/utils_python_data_management.R

tensor_list_to_numpyR Documentation

Convert list of tensors into numpy arrays

Description

Function converts tensors within a list into numpy arrays in order to allow further operations in R.

Usage

tensor_list_to_numpy(tensor_list)

Arguments

tensor_list

list of objects.

Value

Returns the same list with the exception that objects of class torch.Tensor are transformed into numpy arrays. If the tensor requires a gradient and/or is on gpu it is detached and converted. If the object in a list is not of this class the original object is returned.

See Also

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


aifeducation documentation built on Nov. 19, 2025, 5:08 p.m.