Class MultiMessage

Base Type

class MultiMessage : public morpheus::DerivedMultiMessage<MultiMessage>

This class holds data for multiple messages (rows in a DataFrame) at a time. To avoid copying data for slicing operations, it holds a reference to a batched metadata object and stores the offset and count into that batch.

Public Functions

MultiMessage(const MultiMessage &other) = default

Default copy constructor.

MultiMessage(std::shared_ptr<MessageMeta> m, TensorIndex offset = 0, TensorIndex count = -1)

Construct a new Multi Message object.

Parameters
  • m – : Deserialized messages metadata for large batch

  • o – : Offset into the metadata batch

  • c – : Messages count

std::vector<std::string> get_meta_column_names() const

TableInfo get_meta()

Get the meta object.

Returns

TableInfo

TableInfo get_meta(const std::string &col_name)

Returns column value from a meta object.

Parameters

col_name

Throws
  • std::runtime_error

  • std::runtime_error

Returns

TableInfo

TableInfo get_meta(const std::vector<std::string> &column_names)

Returns columns value from a meta object. When columns_names is empty all columns are returned.

Parameters

column_names

Throws

std::runtime_error

Returns

TableInfo

void set_meta(const std::string &col_name, TensorObject tensor)

Set the meta object with a given column name.

Parameters
  • col_name

  • tensor

void set_meta(const std::vector<std::string> &column_names, const std::vector<TensorObject> &tensors)

Set the meta object with a given column names.

Parameters
  • column_names

  • tensors

Public Members

std::shared_ptr<MessageMeta> meta

TensorIndex mess_offset = {0}

TensorIndex mess_count = {0}

Protected Functions

virtual void get_slice_impl(std::shared_ptr<MultiMessage> new_message, TensorIndex start, TensorIndex stop) const override

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

virtual void copy_ranges_impl(std::shared_ptr<MultiMessage> new_message, const std::vector<RangeType> &ranges, TensorIndex num_selected_rows) const override

Similar to get_slice_impl, performs a copy of all attributes in new_message according to the rows specified by ranges. Subclasses need only be concerned with copying their own attributes, and can safely avoid overriding this method if they don’t add any new attributes to their base.

Parameters
  • new_message

  • ranges

  • num_selected_rows

virtual std::shared_ptr<MessageMeta> copy_meta_ranges(const std::vector<RangeType> &ranges) const

Creates a deep copy of meta with the specified ranges.

Parameters

ranges

Returns

std::shared_ptr<MessageMeta>

std::vector<RangeType> apply_offset_to_ranges(TensorIndex offset, const std::vector<RangeType> &ranges) const

Applies the message offset to the elements in ranges casting the results to TensorIndex

Parameters
  • offset

  • ranges

Returns

std::vector<RangeType>

Previous Class MultiInferenceNLPMessage
Next Class MultiResponseMessage
© Copyright 2024, NVIDIA. Last updated on Apr 25, 2024.