def _conv_general_dimension_numbers_proto(dimension_numbers):
    'Converts a ConvDimensionNumbers to an XLA ConvolutionDimensionNumbers.'
    assert isinstance(dimension_numbers, lax.ConvDimensionNumbers)
    (lhs_spec, rhs_spec, out_spec) = dimension_numbers
    proto = xla_data_pb2.ConvolutionDimensionNumbers()
    proto.input_batch_dimension = lhs_spec[0]
    proto.input_feature_dimension = lhs_spec[1]
    proto.output_batch_dimension = out_spec[0]
    proto.output_feature_dimension = out_spec[1]
    proto.kernel_output_feature_dimension = rhs_spec[0]
    proto.kernel_input_feature_dimension = rhs_spec[1]
    proto.input_spatial_dimensions.extend(lhs_spec[2:])
    proto.kernel_spatial_dimensions.extend(rhs_spec[2:])
    proto.output_spatial_dimensions.extend(out_spec[2:])
    return proto
Converts a ConvDimensionNumbers to an XLA ConvolutionDimensionNumbers.
def _conv_general_dimension_numbers_proto(dimension_numbers):
    
    assert isinstance(dimension_numbers, lax.ConvDimensionNumbers)
    (lhs_spec, rhs_spec, out_spec) = dimension_numbers
    proto = xla_data_pb2.ConvolutionDimensionNumbers()
    proto.input_batch_dimension = lhs_spec[0]
    proto.input_feature_dimension = lhs_spec[1]
    proto.output_batch_dimension = out_spec[0]
    proto.output_feature_dimension = out_spec[1]
    proto.kernel_output_feature_dimension = rhs_spec[0]
    proto.kernel_input_feature_dimension = rhs_spec[1]
    proto.input_spatial_dimensions.extend(lhs_spec[2:])
    proto.kernel_spatial_dimensions.extend(rhs_spec[2:])
    proto.output_spatial_dimensions.extend(out_spec[2:])
    return proto