diff --git a/TensorFlow/contrib/cv/BISIMULATION_ID2029_for_Tensorflow/grid_world.py b/TensorFlow/contrib/cv/BISIMULATION_ID2029_for_Tensorflow/grid_world.py index c41aeaf551f040c9eec2d014e10371b48821a249..df3aac9fec57f9184a9c1c7bd9bb3a90ac1e4d40 100644 --- a/TensorFlow/contrib/cv/BISIMULATION_ID2029_for_Tensorflow/grid_world.py +++ b/TensorFlow/contrib/cv/BISIMULATION_ID2029_for_Tensorflow/grid_world.py @@ -582,7 +582,8 @@ class GridWorld(object): config_proto = tf.ConfigProto() custom_op = config_proto.graph_options.rewrite_options.custom_optimizers.add() custom_op.name = 'NpuOptimizer' - custom_op.parameter_map["precision_mode"].s = tf.compat.as_bytes("allow_fp32_to_fp16") + custom_op.parameter_map["precision_mode"].s = tf.compat.as_bytes("allow_mix_precision") + custom_op.parameter_map["customize_dtypes"].s = tf.compat.as_bytes("./matmul_setting.cfg") config = npu_config_proto(config_proto=config_proto) with tf.Session(config=config) as sess: summary_writer.add_graph(graph=tf.get_default_graph()) diff --git a/TensorFlow/contrib/cv/BISIMULATION_ID2029_for_Tensorflow/matmul_setting.cfg b/TensorFlow/contrib/cv/BISIMULATION_ID2029_for_Tensorflow/matmul_setting.cfg new file mode 100644 index 0000000000000000000000000000000000000000..3bf1b03dde1dce2e8e9578771c2f9b3784fb89b0 --- /dev/null +++ b/TensorFlow/contrib/cv/BISIMULATION_ID2029_for_Tensorflow/matmul_setting.cfg @@ -0,0 +1,3 @@ +OpType::MatMulV2:InputDtype:float16,float16,float32,OutputDtype:float32 +OpType::BatchMatMul:InputDtype:float16,float16,OutputDtype:float32 +OpType::BatchMatMulV2:InputDtype:float16,float16,OutputDtype:float32