Program Listing for File tensor_object.cpp

Return to documentation for file (morpheus/_lib/src/objects/tensor_object.cpp)

Copy
Copied!
            

#include "morpheus/objects/tensor_object.hpp" #include <vector> namespace morpheus { static void set_contiguous_stride(const std::vector<TensorIndex>& shape, std::vector<TensorIndex>& stride) { stride.resize(shape.size()); TensorIndex ttl = 1; auto rank = shape.size(); for (int i = rank - 1; i >= 0; i--) { stride[i] = ttl; ttl *= shape.at(i); } } void TensorObject::throw_on_invalid_storage() {} } // namespace morpheus

© Copyright 2023, NVIDIA. Last updated on Feb 3, 2023.