SetInstantiationNum

Function Usage

Sets the actual number of inputs corresponding to an input defined by the IR prototype.

Prototype

1
void SetInstantiationNum(const uint32_t instantiation_num)

Parameters

Parameter

Input/Output

Description

instantiation_num

Input

Number of instantiated inputs.

Returns

None

Constraints

None

Examples

1
2
3
4
5
6
7
const auto &ir_inputs = node->GetOpDesc()->GetIrInputs();  // All inputs defined by the operator IR prototype
for (size_t i = 0; i < ir_inputs.size(); ++i) {
  auto ins_info = compute_node_info.MutableInputInstanceInfo(i);  // Obtain the AnchorInstanceInfo object corresponding to the ith IR input.
  GE_ASSERT_NOTNULL(ins_info);
  size_t instance_num = ir_index_to_instance_index_pair_map[i].second; // Obtain the actual number of inputs corresponding to the operator IR input after statistics collection.
  ins_info->SetInstantiationNum(instance_num); // Save the information to the AnchorInstanceInfo object corresponding to the IR input.
}