Overview

This class describes the mapping between the input and output in the operator prototype definition and the actual input and output after operator instantiation. Each AnchorInstanceInfo object corresponds to an input or output and records the following key information:

  • instantiation_num_: number of instances corresponding to the input or output defined by the prototype in the actual input or output.
  • instance_start_: start index corresponding to the input or output defined by the prototype in the actual input or output.

Currently, the prototype definition provides three types of inputs: required input, optional input, and dynamic input. Only one type of output is provided: required output. The details are as follows.

Input Type

instantiation_num_

instance_start_

Required input

The value must be 1. Otherwise, an error is reported.

The value of instance_start_ starts from 0. For example, if instance i is A and instance i minus 1 is B, the derivation relationship is as follows: A.instance_start_ = B.instance_start_ + B.instantiation_num_.

Optional input

If there is an actual input, the value is 1. Otherwise, the value is 0.

Dynamic input

The value is 1 to N based on the actual number of inputs.

Required output

The value must be 1. Otherwise, an error is reported.

Header Files to Be Included

1
#include <compute_node_info.h>

Public Member Functions

AnchorInstanceInfo()
AnchorInstanceInfo(const uint32_t instance_start, const uint32_t instantiation_num)
size_t GetInstanceNum() const
size_t GetInstanceStart() const
void SetInstanceStart(const uint32_t instance_start)
void SetInstantiationNum(const uint32_t instantiation_num)