:gitee_url: https://gitee.com/mindspore/docs .. _program_listing_file_include_cfg.h: Program Listing for File cfg.h ============================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/cfg.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef MINDSPORE_INCLUDE_API_CFG_H #define MINDSPORE_INCLUDE_API_CFG_H #include #include #include #include #include "include/api/data_type.h" #include "include/api/dual_abi_helper.h" namespace mindspore { class MixPrecisionCfg { public: MixPrecisionCfg() { this->dynamic_loss_scale_ = false; this->loss_scale_ = 128.0f; this->num_of_not_nan_iter_th_ = 1000; } bool dynamic_loss_scale_ = false; float loss_scale_; uint32_t num_of_not_nan_iter_th_; bool is_raw_mix_precision_ = false; }; class TrainCfg { public: TrainCfg() { this->loss_name_ = "_loss_fn"; } OptimizationLevel optimization_level_ = kO0; std::string loss_name_; MixPrecisionCfg mix_precision_cfg_; bool accumulate_gradients_ = false; }; } // namespace mindspore #endif // MINDSPORE_INCLUDE_API_CFG_H