Defined in File multi_tensor.hpp
Base Type
public morpheus::DerivedMultiMessage< MultiTensorMessage, MultiMessage >
(Template Class DerivedMultiMessage)
-
class MultiTensorMessage : public morpheus::DerivedMultiMessage<MultiTensorMessage, MultiMessage>
Base class for MultiInferenceMessage & MultiResponseMessage Contains a pointer to an instance of TensorMemory along with an offset & count to those tensors
mess_offset & mess_count refer to the range of records in meta. offset & count refer to the range of records in TensorMemory
While TensorMemory can contain multiple tensors, it is a requirement that they are all of the same length and that element N in each tensor refers to the same record
Public Functions
-
MultiTensorMessage(const MultiTensorMessage &other) = default
Default copy constructor.
Construct a new Multi Tensor Message object.
- Parameters
meta – Holds a data table, in practice a cudf DataFrame, with the ability to return both Python and C++ representations of the table
mess_offset – Offset into the metadata batch
mess_count – Messages count
memory – Shared pointer of a tensor memory
offset – Message offset in tensor memory instance
count – Message count in tensor memory instance
-
const TensorObject get_tensor(const std::string &name) const
Returns a tensor with the given name. Will halt on a fatal error if the tensor does not exist.
- Parameters
name –
- Returns
const TensorObject
-
TensorObject get_tensor(const std::string &name)
Returns a tensor with the given name. Will halt on a fatal error if the tensor does not exist.
- Parameters
name –
- Returns
-
void set_tensor(const std::string &name, const TensorObject &value)
Update the value of a given tensor. The tensor must already exist, otherwise this will halt on a fatal error.
- Parameters
name –
value –
Public Members
-
std::shared_ptr<morpheus::TensorMemory> memory
-
std::size_t offset = {0}
-
std::size_t count = {0}
Protected Functions
Applies a slice of the attribures contained in
new_message
. Subclasses need only be concerned with their own attributes, and can safely avoid overriding this method if they don’t add any new attributes to their base.- Parameters
new_message –
start –
stop –
-
std::shared_ptr<morpheus::TensorMemory> copy_input_ranges(const std::vector<std::pair<std::size_t, std::size_t>> &ranges, std::size_t num_selected_rows) const
-
TensorObject get_tensor_impl(const std::string &name) const
-
MultiTensorMessage(const MultiTensorMessage &other) = default