Program Listing for File tensor_memory.cpp

Return to documentation for file (morpheus/_lib/src/messages/memory/tensor_memory.cpp)

Copy
Copied!
            

#include "morpheus/messages/memory/tensor_memory.hpp" #include <string> #include <vector> namespace morpheus { /****** Component public implementations *******************/ /****** TensorMemory****************************************/ TensorMemory::TensorMemory(size_t count) : count(count) {} TensorMemory::TensorMemory(size_t count, tensor_map_t &&tensors) : count(count), tensors(std::move(tensors)) {} bool TensorMemory::has_tensor(const std::string &name) const { return this->tensors.find(name) != this->tensors.end(); } TensorMemory::tensor_map_t TensorMemory::copy_tensor_ranges( const std::vector<std::pair<TensorIndex, TensorIndex>> &ranges, size_t num_selected_rows) const { tensor_map_t tensors; for (const auto &p : this->tensors) { tensors.insert(std::pair{p.first, p.second.copy_rows(ranges, num_selected_rows)}); } return tensors; } } // namespace morpheus

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