MCPcopy Create free account
hub / github.com/NVIDIA/DALI / GetDLTensorListView

Function GetDLTensorListView

dali/pipeline/data/dltensor.h:270–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268 */
269template <typename Backend>
270std::vector<DLMTensorPtr> GetDLTensorListView(TensorList<Backend> &tensor_list) {
271 int device_id = tensor_list.device_id();
272 bool pinned = tensor_list.is_pinned();
273
274 std::vector<DLMTensorPtr> dl_tensors{};
275 dl_tensors.reserve(tensor_list.num_samples());
276
277 for (int i = 0; i < tensor_list.num_samples(); ++i)
278 dl_tensors.push_back(GetDLTensorView(tensor_list[i], pinned, device_id));
279 return dl_tensors;
280}
281
282
283/** Gets a DLManagedTensor which shares the buffer ownership with a tensor.

Callers 2

TESTFunction · 0.85
TensorListToDLPackViewFunction · 0.85

Calls 5

GetDLTensorViewFunction · 0.85
device_idMethod · 0.45
reserveMethod · 0.45
num_samplesMethod · 0.45
push_backMethod · 0.45

Tested by 1

TESTFunction · 0.68