未验证 提交 821e5509 编写于 作者: X xiongkun 提交者: GitHub

stop_gradient=True for input spec (#1943)

上级 8f5fe615
...@@ -64,6 +64,7 @@ def apply_to_static(config, model): ...@@ -64,6 +64,7 @@ def apply_to_static(config, model):
specs = None specs = None
if 'image_shape' in config['Global']: if 'image_shape' in config['Global']:
specs = [InputSpec([None] + config['Global']['image_shape'])] specs = [InputSpec([None] + config['Global']['image_shape'])]
specs[0].stop_gradient = True
model = to_static(model, input_spec=specs) model = to_static(model, input_spec=specs)
logger.info("Successfully to apply @to_static with specs: {}".format( logger.info("Successfully to apply @to_static with specs: {}".format(
specs)) specs))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册