set_graph_exec_config
Description
Sets the compilation and execution options for a computational graph. After this API is called, configured attributes are added to the fetch node.
Prototype
def set_graph_exec_config(fetch, dynamic_input=False, dynamic_graph_execute_mode="dynamic_execute", dynamic_inputs_shape_range=None, is_train_graph=False, experimental_config=None)
Options
Returns
fetch
Restrictions
If both graph-level and session-level parameters are set, the graph-level parameters take precedence over session-level ones.
Example
Generally, gradient update operations are performed in training networks. The return value of the gradient update operation can be used as the fetch argument in set_graph_exec_config.
1 2 3 4 | from npu_bridge.estimator.npu import util train_op = util.set_graph_exec_config(train_op, dynamic_input=True, dynamic_inputs_shape_range="data:[1~2];getnext:[1~50,1~50],[1~50,1~50]") |
Parent topic: npu_bridge.estimator.npu.util