def METHOD_NAME(graph, node):
    common_dtype = graph.get_dtype(node.input[0])
    for inp in node.input[1:]:
        if graph.get_dtype(inp) != common_dtype:
            inp_cast = graph.insert_new_node_on_input(node, "Cast", inp, to=common_dtype)
            graph.copy_shape(inp, inp_cast.output[0])
            graph.set_dtype(inp_cast.output[0], common_dtype)