MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / init_tensor

Method init_tensor

utils/Utils.h:352–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350 */
351 template <typename T>
352 void init_tensor(T &tensor, arm_compute::DataType dt)
353 {
354 ARM_COMPUTE_ERROR_ON(!is_open());
355 ARM_COMPUTE_ERROR_ON(dt != arm_compute::DataType::F32);
356
357 // Use the size of the input NPY tensor
358 TensorShape shape;
359 shape.set_num_dimensions(_shape.size());
360 for (size_t i = 0; i < _shape.size(); ++i)
361 {
362 size_t src = i;
363 if (_fortran_order)
364 {
365 src = _shape.size() - 1 - i;
366 }
367 shape.set(i, _shape.at(src));
368 }
369
370 arm_compute::TensorInfo tensor_info(shape, 1, dt);
371 tensor.allocator()->init(tensor_info);
372 }
373
374 /** Fill a tensor with the content of the currently open NPY file.
375 *

Callers

nothing calls this directly

Calls 5

set_num_dimensionsMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45
initMethod · 0.45
allocatorMethod · 0.45

Tested by

no test coverage detected