def remove_cast_int32(self, input_name: str):
    input_name_to_nodes = self.model.input_name_to_nodes()
    nodes = input_name_to_nodes[input_name]
    for node in nodes:
        if (node.op_type == 'Cast'):
            is_int32 = False
            for att in node.attribute:
                if ((att.name == 'to') and (att.i == int(TensorProto.INT32))):
                    is_int32 = True
                    break
            if is_int32:
                output_name = node.output[0]
                self.model.remove_node(node)
                self.model.replace_input_of_all_nodes(output_name, input_name)
def remove_cast_int32(self, input_name: str):
    input_name_to_nodes = self.model.input_name_to_nodes()
    nodes = input_name_to_nodes[input_name]
    for node in nodes:
        if (node.op_type == 'Cast'):
            is_int32 = False
            for att in node.attribute:
                if ((att.name == 'to') and (att.i == int(TensorProto.INT32))):
                    is_int32 = True
                    break
            if is_int32:
                output_name = node.output[0]
                self.model.remove_node(node)
                self.model.replace_input_of_all_nodes(output_name, input_name)