@@ -695,16 +695,18 @@ struct TORCH_API NoTF32Guard {
695695 bool changed = false ;
696696};
697697
698- template <Float32Backend target_backend, Float32Op target_op>
698+ template <Float32Backend target_backend, Float32Op target_op>
699699struct Fp32PrecisonGuard {
700700 Fp32PrecisonGuard (const Float32Precision new_precision) {
701701 if (new_precision == Float32Precision::NONE) {
702- return ;
702+ return ;
703703 }
704- saved_precision = globalContext ().float32Precision (target_backend, target_op);
704+ saved_precision =
705+ globalContext ().float32Precision (target_backend, target_op);
705706 changed = (new_precision != saved_precision);
706707 if (changed) {
707- globalContext ().setFloat32Precision (target_backend, target_op, new_precision);
708+ globalContext ().setFloat32Precision (
709+ target_backend, target_op, new_precision);
708710 }
709711 }
710712 Fp32PrecisonGuard (Fp32PrecisonGuard&& other) = delete ;
@@ -713,9 +715,11 @@ struct Fp32PrecisonGuard {
713715 Fp32PrecisonGuard& operator =(Fp32PrecisonGuard&&) = delete ;
714716 ~Fp32PrecisonGuard () {
715717 if (changed) {
716- globalContext ().setFloat32Precision (target_backend, target_op, saved_precision);
718+ globalContext ().setFloat32Precision (
719+ target_backend, target_op, saved_precision);
717720 }
718721 }
722+
719723 private:
720724 Float32Precision saved_precision;
721725 bool changed = false ;
0 commit comments