"""
- Copyright (c) 2018 Intel Corporation
+ Copyright (c) 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
node.out_node(0).shape = shape_infer(node)
if value_infer is not None and \
- 'value' in node.in_node() and \
- node.in_node().value is not None:
+ 'value' in node.in_node() and \
+ node.in_node().value is not None:
node.out_node(0).value = value_infer(node)
-def copy_shape_infer(node):
+
+def copy_shape_infer(node, value_infer=None):
"""
Sets output dimensions of node equal to input ones
Args:
node: graph node
"""
- single_output_infer(node, lambda n: n.in_node().shape)
+ single_output_infer(node, lambda n: n.in_node().shape, value_infer)
+
+
+def copy_value(node):
+ return None if node.in_node().value is None else node.in_node().value.copy()