Struct TensorObject

struct TensorObject

Handle for interacting with Morpheus Tensor objects. Typically constructed using the Tensor::create factory method.

Public Functions

TensorObject() = default
inline TensorObject(std::shared_ptr<MemoryDescriptor> md, std::shared_ptr<ITensor> tensor)
inline TensorObject(std::shared_ptr<ITensor> tensor)
TensorObject(const TensorObject &other) = default
inline TensorObject(TensorObject &&other)
~TensorObject() = default
inline void *data() const
inline DataType dtype() const
inline std::size_t count() const
inline std::size_t bytes() const
inline RankType rank() const
inline std::size_t dtype_size() const
inline std::vector<std::size_t> get_shape() const
inline std::vector<std::size_t> get_stride() const
inline TensorIndex shape(std::uint32_t idx) const
inline TensorIndex stride(std::uint32_t idx) const
inline bool is_compact() const
inline TensorObject slice(std::vector<TensorIndex> min_dims, std::vector<TensorIndex> max_dims) const
inline TensorObject reshape(const std::vector<TensorIndex> &dims) const
inline TensorObject deep_copy() const
template<typename T = uint8_t>
inline std::vector<T> get_host_data() const
template<typename T, size_t N>
inline T read_element(const TensorIndex (&idx)[N]) const
template<typename T, size_t N>
inline T read_element(const std::array<TensorIndex, N> idx) const
inline TensorObject &operator=(TensorObject &&other) noexcept
inline TensorObject &operator=(const TensorObject &other)
inline std::shared_ptr<ITensor> get_tensor() const
inline std::shared_ptr<MemoryDescriptor> get_memory() const
inline std::string get_numpy_typestr() const
inline TensorObject as_type(DataType dtype) const
inline TensorObject copy_rows(const std::vector<std::pair<TensorIndex, TensorIndex>> &selected_rows, TensorIndex num_rows) const

Creates a deep copy of the rows specified in the exclusive ranges of vector<pair<start, stop>> of the stop row.

Parameters
  • selected_rows

  • num_rows

Returns

TensorObject

Protected Functions

void throw_on_invalid_storage()

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