fn write_to_with_cached_sizes()

in src/protos/rewriter_config.rs [1304:1416]


    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
        if self.cpu_layout_conversion != RewriterConfig_CpuLayout::NO_CONVERSION_ON_CPU {
            os.write_enum(50, ::protobuf::ProtobufEnum::value(&self.cpu_layout_conversion))?;
        }
        if self.layout_optimizer != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.layout_optimizer))?;
        }
        if self.constant_folding != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(3, ::protobuf::ProtobufEnum::value(&self.constant_folding))?;
        }
        if self.shape_optimization != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(13, ::protobuf::ProtobufEnum::value(&self.shape_optimization))?;
        }
        if self.remapping != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(14, ::protobuf::ProtobufEnum::value(&self.remapping))?;
        }
        if self.common_subgraph_elimination != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(24, ::protobuf::ProtobufEnum::value(&self.common_subgraph_elimination))?;
        }
        if self.arithmetic_optimization != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(7, ::protobuf::ProtobufEnum::value(&self.arithmetic_optimization))?;
        }
        if self.dependency_optimization != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(8, ::protobuf::ProtobufEnum::value(&self.dependency_optimization))?;
        }
        if self.loop_optimization != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(9, ::protobuf::ProtobufEnum::value(&self.loop_optimization))?;
        }
        if self.function_optimization != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(10, ::protobuf::ProtobufEnum::value(&self.function_optimization))?;
        }
        if self.debug_stripper != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(11, ::protobuf::ProtobufEnum::value(&self.debug_stripper))?;
        }
        if self.disable_model_pruning != false {
            os.write_bool(2, self.disable_model_pruning)?;
        }
        if self.scoped_allocator_optimization != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(15, ::protobuf::ProtobufEnum::value(&self.scoped_allocator_optimization))?;
        }
        if self.pin_to_host_optimization != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(18, ::protobuf::ProtobufEnum::value(&self.pin_to_host_optimization))?;
        }
        if self.implementation_selector != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(22, ::protobuf::ProtobufEnum::value(&self.implementation_selector))?;
        }
        if self.auto_mixed_precision != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(23, ::protobuf::ProtobufEnum::value(&self.auto_mixed_precision))?;
        }
        if self.auto_mixed_precision_mkl != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(25, ::protobuf::ProtobufEnum::value(&self.auto_mixed_precision_mkl))?;
        }
        if self.disable_meta_optimizer != false {
            os.write_bool(19, self.disable_meta_optimizer)?;
        }
        if self.use_plugin_optimizers != RewriterConfig_Toggle::DEFAULT {
            os.write_enum(28, ::protobuf::ProtobufEnum::value(&self.use_plugin_optimizers))?;
        }
        if self.meta_optimizer_iterations != RewriterConfig_NumIterationsType::DEFAULT_NUM_ITERS {
            os.write_enum(12, ::protobuf::ProtobufEnum::value(&self.meta_optimizer_iterations))?;
        }
        if self.min_graph_nodes != 0 {
            os.write_int32(17, self.min_graph_nodes)?;
        }
        if self.experimental_disable_compressed_tensor_optimization != false {
            os.write_bool(26, self.experimental_disable_compressed_tensor_optimization)?;
        }
        if self.experimental_disable_folding_quantization_emulation != false {
            os.write_bool(27, self.experimental_disable_folding_quantization_emulation)?;
        }
        if self.memory_optimization != RewriterConfig_MemOptType::DEFAULT_MEM_OPT {
            os.write_enum(4, ::protobuf::ProtobufEnum::value(&self.memory_optimization))?;
        }
        if !self.memory_optimizer_target_node_name_scope.is_empty() {
            os.write_string(6, &self.memory_optimizer_target_node_name_scope)?;
        }
        if self.meta_optimizer_timeout_ms != 0 {
            os.write_int64(20, self.meta_optimizer_timeout_ms)?;
        }
        if let Some(ref v) = self.auto_parallel.as_ref() {
            os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?;
            os.write_raw_varint32(v.get_cached_size())?;
            v.write_to_with_cached_sizes(os)?;
        }
        if self.fail_on_optimizer_errors != false {
            os.write_bool(21, self.fail_on_optimizer_errors)?;
        }
        if let Some(ref v) = self.scoped_allocator_opts.as_ref() {
            os.write_tag(16, ::protobuf::wire_format::WireTypeLengthDelimited)?;
            os.write_raw_varint32(v.get_cached_size())?;
            v.write_to_with_cached_sizes(os)?;
        }
        for v in &self.optimizers {
            os.write_string(100, &v)?;
        };
        for v in &self.custom_optimizers {
            os.write_tag(200, ::protobuf::wire_format::WireTypeLengthDelimited)?;
            os.write_raw_varint32(v.get_cached_size())?;
            v.write_to_with_cached_sizes(os)?;
        };
        if let Some(ref v) = self.inter_optimizer_verifier_config.as_ref() {
            os.write_tag(300, ::protobuf::wire_format::WireTypeLengthDelimited)?;
            os.write_raw_varint32(v.get_cached_size())?;
            v.write_to_with_cached_sizes(os)?;
        }
        if let Some(ref v) = self.post_optimization_verifier_config.as_ref() {
            os.write_tag(301, ::protobuf::wire_format::WireTypeLengthDelimited)?;
            os.write_raw_varint32(v.get_cached_size())?;
            v.write_to_with_cached_sizes(os)?;
        }
        os.write_unknown_fields(self.get_unknown_fields())?;
        ::std::result::Result::Ok(())
    }