def _scatter_dimensions_proto(indices_shape, dimension_numbers):
    proto = xla_data_pb2.ScatterDimensionNumbers()
    proto.update_window_dims.extend(dimension_numbers.update_window_dims)
    proto.inserted_window_dims.extend(dimension_numbers.inserted_window_dims)
    proto.scatter_dims_to_operand_dims.extend(dimension_numbers.scatter_dims_to_operand_dims)
    assert indices_shape
    proto.index_vector_dim = (len(indices_shape) - 1)
    return proto
def _scatter_dimensions_proto(indices_shape, dimension_numbers):
    proto = xla_data_pb2.ScatterDimensionNumbers()
    proto.update_window_dims.extend(dimension_numbers.update_window_dims)
    proto.inserted_window_dims.extend(dimension_numbers.inserted_window_dims)
    proto.scatter_dims_to_operand_dims.extend(dimension_numbers.scatter_dims_to_operand_dims)
    assert indices_shape
    proto.index_vector_dim = (len(indices_shape) - 1)
    return proto