Copy
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 inDataLoader.- Parameters:
data – a single data point to be converted
Help improve this page
Found an error, an unclear step, or a missing example?
tensorplay.utils.data.default_collate
Take in a batch of data and put the elements within the batch into a tensor with an additional outer dimension - batch size.
tensorplay.utils.data.get_worker_info
Returns the information about the current DataLoader iterator worker process. When called in a worker process, returns a WorkerInfo object with information about that worker process; otherwise returns None .
