#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![rustfmt::skip]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_imports)]
#![allow(unused_results)]
#[derive(PartialEq,Clone,Default)]
pub struct CudnnConvBackendConfig {
pub algorithm: i64,
pub tensor_ops_enabled: bool,
pub conv_result_scale: f64,
pub activation_mode: i64,
pub side_input_scale: f64,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a CudnnConvBackendConfig {
fn default() -> &'a CudnnConvBackendConfig {
<CudnnConvBackendConfig as ::protobuf::Message>::default_instance()
}
}
impl CudnnConvBackendConfig {
pub fn new() -> CudnnConvBackendConfig {
::std::default::Default::default()
}
pub fn get_algorithm(&self) -> i64 {
self.algorithm
}
pub fn clear_algorithm(&mut self) {
self.algorithm = 0;
}
pub fn set_algorithm(&mut self, v: i64) {
self.algorithm = v;
}
pub fn get_tensor_ops_enabled(&self) -> bool {
self.tensor_ops_enabled
}
pub fn clear_tensor_ops_enabled(&mut self) {
self.tensor_ops_enabled = false;
}
pub fn set_tensor_ops_enabled(&mut self, v: bool) {
self.tensor_ops_enabled = v;
}
pub fn get_conv_result_scale(&self) -> f64 {
self.conv_result_scale
}
pub fn clear_conv_result_scale(&mut self) {
self.conv_result_scale = 0.;
}
pub fn set_conv_result_scale(&mut self, v: f64) {
self.conv_result_scale = v;
}
pub fn get_activation_mode(&self) -> i64 {
self.activation_mode
}
pub fn clear_activation_mode(&mut self) {
self.activation_mode = 0;
}
pub fn set_activation_mode(&mut self, v: i64) {
self.activation_mode = v;
}
pub fn get_side_input_scale(&self) -> f64 {
self.side_input_scale
}
pub fn clear_side_input_scale(&mut self) {
self.side_input_scale = 0.;
}
pub fn set_side_input_scale(&mut self, v: f64) {
self.side_input_scale = v;
}
}
impl ::protobuf::Message for CudnnConvBackendConfig {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_int64()?;
self.algorithm = tmp;
},
2 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_bool()?;
self.tensor_ops_enabled = tmp;
},
4 => {
if wire_type != ::protobuf::wire_format::WireTypeFixed64 {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_double()?;
self.conv_result_scale = tmp;
},
3 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_int64()?;
self.activation_mode = tmp;
},
5 => {
if wire_type != ::protobuf::wire_format::WireTypeFixed64 {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_double()?;
self.side_input_scale = tmp;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if self.algorithm != 0 {
my_size += ::protobuf::rt::value_size(1, self.algorithm, ::protobuf::wire_format::WireTypeVarint);
}
if self.tensor_ops_enabled != false {
my_size += 2;
}
if self.conv_result_scale != 0. {
my_size += 9;
}
if self.activation_mode != 0 {
my_size += ::protobuf::rt::value_size(3, self.activation_mode, ::protobuf::wire_format::WireTypeVarint);
}
if self.side_input_scale != 0. {
my_size += 9;
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if self.algorithm != 0 {
os.write_int64(1, self.algorithm)?;
}
if self.tensor_ops_enabled != false {
os.write_bool(2, self.tensor_ops_enabled)?;
}
if self.conv_result_scale != 0. {
os.write_double(4, self.conv_result_scale)?;
}
if self.activation_mode != 0 {
os.write_int64(3, self.activation_mode)?;
}
if self.side_input_scale != 0. {
os.write_double(5, self.side_input_scale)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> CudnnConvBackendConfig {
CudnnConvBackendConfig::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
"algorithm",
|m: &CudnnConvBackendConfig| { &m.algorithm },
|m: &mut CudnnConvBackendConfig| { &mut m.algorithm },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"tensor_ops_enabled",
|m: &CudnnConvBackendConfig| { &m.tensor_ops_enabled },
|m: &mut CudnnConvBackendConfig| { &mut m.tensor_ops_enabled },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
"conv_result_scale",
|m: &CudnnConvBackendConfig| { &m.conv_result_scale },
|m: &mut CudnnConvBackendConfig| { &mut m.conv_result_scale },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
"activation_mode",
|m: &CudnnConvBackendConfig| { &m.activation_mode },
|m: &mut CudnnConvBackendConfig| { &mut m.activation_mode },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
"side_input_scale",
|m: &CudnnConvBackendConfig| { &m.side_input_scale },
|m: &mut CudnnConvBackendConfig| { &mut m.side_input_scale },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<CudnnConvBackendConfig>(
"CudnnConvBackendConfig",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static CudnnConvBackendConfig {
static instance: ::protobuf::rt::LazyV2<CudnnConvBackendConfig> = ::protobuf::rt::LazyV2::INIT;
instance.get(CudnnConvBackendConfig::new)
}
}
impl ::protobuf::Clear for CudnnConvBackendConfig {
fn clear(&mut self) {
self.algorithm = 0;
self.tensor_ops_enabled = false;
self.conv_result_scale = 0.;
self.activation_mode = 0;
self.side_input_scale = 0.;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for CudnnConvBackendConfig {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for CudnnConvBackendConfig {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct GemmBackendConfig {
pub alpha_real: f64,
pub alpha_imag: f64,
pub beta: f64,
pub dot_dimension_numbers: ::protobuf::SingularPtrField<super::xla_data::DotDimensionNumbers>,
pub batch_size: i64,
pub algorithm: ::std::option::Option<GemmBackendConfig_oneof_algorithm>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a GemmBackendConfig {
fn default() -> &'a GemmBackendConfig {
<GemmBackendConfig as ::protobuf::Message>::default_instance()
}
}
#[derive(Clone,PartialEq,Debug)]
pub enum GemmBackendConfig_oneof_algorithm {
selected_algorithm(i64),
}
impl GemmBackendConfig {
pub fn new() -> GemmBackendConfig {
::std::default::Default::default()
}
pub fn get_selected_algorithm(&self) -> i64 {
match self.algorithm {
::std::option::Option::Some(GemmBackendConfig_oneof_algorithm::selected_algorithm(v)) => v,
_ => 0,
}
}
pub fn clear_selected_algorithm(&mut self) {
self.algorithm = ::std::option::Option::None;
}
pub fn has_selected_algorithm(&self) -> bool {
match self.algorithm {
::std::option::Option::Some(GemmBackendConfig_oneof_algorithm::selected_algorithm(..)) => true,
_ => false,
}
}
pub fn set_selected_algorithm(&mut self, v: i64) {
self.algorithm = ::std::option::Option::Some(GemmBackendConfig_oneof_algorithm::selected_algorithm(v))
}
pub fn get_alpha_real(&self) -> f64 {
self.alpha_real
}
pub fn clear_alpha_real(&mut self) {
self.alpha_real = 0.;
}
pub fn set_alpha_real(&mut self, v: f64) {
self.alpha_real = v;
}
pub fn get_alpha_imag(&self) -> f64 {
self.alpha_imag
}
pub fn clear_alpha_imag(&mut self) {
self.alpha_imag = 0.;
}
pub fn set_alpha_imag(&mut self, v: f64) {
self.alpha_imag = v;
}
pub fn get_beta(&self) -> f64 {
self.beta
}
pub fn clear_beta(&mut self) {
self.beta = 0.;
}
pub fn set_beta(&mut self, v: f64) {
self.beta = v;
}
pub fn get_dot_dimension_numbers(&self) -> &super::xla_data::DotDimensionNumbers {
self.dot_dimension_numbers.as_ref().unwrap_or_else(|| <super::xla_data::DotDimensionNumbers as ::protobuf::Message>::default_instance())
}
pub fn clear_dot_dimension_numbers(&mut self) {
self.dot_dimension_numbers.clear();
}
pub fn has_dot_dimension_numbers(&self) -> bool {
self.dot_dimension_numbers.is_some()
}
pub fn set_dot_dimension_numbers(&mut self, v: super::xla_data::DotDimensionNumbers) {
self.dot_dimension_numbers = ::protobuf::SingularPtrField::some(v);
}
pub fn mut_dot_dimension_numbers(&mut self) -> &mut super::xla_data::DotDimensionNumbers {
if self.dot_dimension_numbers.is_none() {
self.dot_dimension_numbers.set_default();
}
self.dot_dimension_numbers.as_mut().unwrap()
}
pub fn take_dot_dimension_numbers(&mut self) -> super::xla_data::DotDimensionNumbers {
self.dot_dimension_numbers.take().unwrap_or_else(|| super::xla_data::DotDimensionNumbers::new())
}
pub fn get_batch_size(&self) -> i64 {
self.batch_size
}
pub fn clear_batch_size(&mut self) {
self.batch_size = 0;
}
pub fn set_batch_size(&mut self, v: i64) {
self.batch_size = v;
}
}
impl ::protobuf::Message for GemmBackendConfig {
fn is_initialized(&self) -> bool {
for v in &self.dot_dimension_numbers {
if !v.is_initialized() {
return false;
}
};
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.algorithm = ::std::option::Option::Some(GemmBackendConfig_oneof_algorithm::selected_algorithm(is.read_int64()?));
},
2 => {
if wire_type != ::protobuf::wire_format::WireTypeFixed64 {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_double()?;
self.alpha_real = tmp;
},
9 => {
if wire_type != ::protobuf::wire_format::WireTypeFixed64 {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_double()?;
self.alpha_imag = tmp;
},
3 => {
if wire_type != ::protobuf::wire_format::WireTypeFixed64 {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_double()?;
self.beta = tmp;
},
7 => {
::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.dot_dimension_numbers)?;
},
8 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_int64()?;
self.batch_size = tmp;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if self.alpha_real != 0. {
my_size += 9;
}
if self.alpha_imag != 0. {
my_size += 9;
}
if self.beta != 0. {
my_size += 9;
}
if let Some(ref v) = self.dot_dimension_numbers.as_ref() {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
}
if self.batch_size != 0 {
my_size += ::protobuf::rt::value_size(8, self.batch_size, ::protobuf::wire_format::WireTypeVarint);
}
if let ::std::option::Option::Some(ref v) = self.algorithm {
match v {
&GemmBackendConfig_oneof_algorithm::selected_algorithm(v) => {
my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
},
};
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if self.alpha_real != 0. {
os.write_double(2, self.alpha_real)?;
}
if self.alpha_imag != 0. {
os.write_double(9, self.alpha_imag)?;
}
if self.beta != 0. {
os.write_double(3, self.beta)?;
}
if let Some(ref v) = self.dot_dimension_numbers.as_ref() {
os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
}
if self.batch_size != 0 {
os.write_int64(8, self.batch_size)?;
}
if let ::std::option::Option::Some(ref v) = self.algorithm {
match v {
&GemmBackendConfig_oneof_algorithm::selected_algorithm(v) => {
os.write_int64(1, v)?;
},
};
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> GemmBackendConfig {
GemmBackendConfig::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_singular_i64_accessor::<_>(
"selected_algorithm",
GemmBackendConfig::has_selected_algorithm,
GemmBackendConfig::get_selected_algorithm,
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
"alpha_real",
|m: &GemmBackendConfig| { &m.alpha_real },
|m: &mut GemmBackendConfig| { &mut m.alpha_real },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
"alpha_imag",
|m: &GemmBackendConfig| { &m.alpha_imag },
|m: &mut GemmBackendConfig| { &mut m.alpha_imag },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeDouble>(
"beta",
|m: &GemmBackendConfig| { &m.beta },
|m: &mut GemmBackendConfig| { &mut m.beta },
));
fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::xla_data::DotDimensionNumbers>>(
"dot_dimension_numbers",
|m: &GemmBackendConfig| { &m.dot_dimension_numbers },
|m: &mut GemmBackendConfig| { &mut m.dot_dimension_numbers },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
"batch_size",
|m: &GemmBackendConfig| { &m.batch_size },
|m: &mut GemmBackendConfig| { &mut m.batch_size },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<GemmBackendConfig>(
"GemmBackendConfig",
fields,
file_descriptor_proto()
)
})
}
fn default_instance() -> &'static GemmBackendConfig {
static instance: ::protobuf::rt::LazyV2<GemmBackendConfig> = ::protobuf::rt::LazyV2::INIT;
instance.get(GemmBackendConfig::new)
}
}
impl ::protobuf::Clear for GemmBackendConfig {
fn clear(&mut self) {
self.algorithm = ::std::option::Option::None;
self.alpha_real = 0.;
self.alpha_imag = 0.;
self.beta = 0.;
self.dot_dimension_numbers.clear();
self.batch_size = 0;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for GemmBackendConfig {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for GemmBackendConfig {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n9tensorflow/compiler/xla/service/gpu/backend_configs.proto\x12\x07xla.\
gpu\x1a&tensorflow/compiler/xla/xla_data.proto\"\xe3\x01\n\x16CudnnConvB\
ackendConfig\x12\x1c\n\talgorithm\x18\x01\x20\x01(\x03R\talgorithm\x12,\
\n\x12tensor_ops_enabled\x18\x02\x20\x01(\x08R\x10tensorOpsEnabled\x12*\
\n\x11conv_result_scale\x18\x04\x20\x01(\x01R\x0fconvResultScale\x12'\n\
\x0factivation_mode\x18\x03\x20\x01(\x03R\x0eactivationMode\x12(\n\x10si\
de_input_scale\x18\x05\x20\x01(\x01R\x0esideInputScale\"\x90\x02\n\x11Ge\
mmBackendConfig\x12/\n\x12selected_algorithm\x18\x01\x20\x01(\x03H\0R\
\x11selectedAlgorithm\x12\x1d\n\nalpha_real\x18\x02\x20\x01(\x01R\talpha\
Real\x12\x1d\n\nalpha_imag\x18\t\x20\x01(\x01R\talphaImag\x12\x12\n\x04b\
eta\x18\x03\x20\x01(\x01R\x04beta\x12L\n\x15dot_dimension_numbers\x18\
\x07\x20\x01(\x0b2\x18.xla.DotDimensionNumbersR\x13dotDimensionNumbers\
\x12\x1d\n\nbatch_size\x18\x08\x20\x01(\x03R\tbatchSizeB\x0b\n\talgorith\
mb\x06proto3\
";
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
}
pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
file_descriptor_proto_lazy.get(|| {
parse_descriptor_proto()
})
}