This class is used to describe the relationship between the inputs of the IR definition prototype of an operator and the actual inputs. Each AnchorInstanceInfo object corresponds to an IR input and records two pieces of information: instantiation_num_ and instance_start_. instantiation_num_ describes the actual number of inputs corresponding to an IR input, and instance_start_ describes the start index of an IR input in the actual inputs. Currently, the IR definition provides three types of input: mandatory input, optional input, and dynamic input.
| Input Type | instantiation_num_ | instance_start_ |
|---|---|---|
| Mandatory input | The value must be 1. Otherwise, an error is reported. | The start index starts from 0: instance_start_[i] = instance_start_[i-1] + instantiation_num_[i-1]. |
| Optional input | If there is an actual input, the value is 1. Otherwise, the value is 0. | The start index starts from 0: instance_start_[i] = instance_start_[i-1] + instantiation_num_[i-1]. |
| Dynamic input | The value is 0 to N based on the actual number of inputs. | The start index starts from 0: instance_start_[i] = instance_start_[i-1] + instantiation_num_[i-1]. |