Function holoscan::calc_strides
Defined in File tensor.hpp
-
void holoscan::calc_strides(const DLTensor &tensor, std::vector<int64_t> &strides, bool to_num_elements = false)
Fill strides from the given DLTensor object.
The following fields are used to fill strides:
ndim
shape
dtype
If tensor’s strides is nullptr,
stridesargument is filled with the calculated strides of the given DLTensor object. Otherwise,stridesargument is filled with the given DLTensor object’s strides.stridesvector would be resized to the size ofndimfield of the given DLTensor object.- Parameters
tensor – DLTensor object that holds information to fill strides.
strides – [out] Strides to fill.
to_num_elements – If true, the strides in
stridesargument are in number of elements, not bytes (default: false).