TensorPlay
API symbolsutils
Copy
View MarkdownDownload .md

tensorplay.utils.data.default_convert

tensorplay.utils.data.default_convert(data)[source]

Convert each NumPy array element into a tensorplay.Tensor.

If the input is a Sequence, Collection, or Mapping, it tries to convert each element inside to a tensorplay.Tensor. If the input is not a NumPy array, it is left unchanged. This is used as the default function for collation when both batch_sampler and batch_size are NOT defined in DataLoader.

Parameters:

data – a single data point to be converted

Ask DeepWiki