Skip to content

Commit

Permalink
Deprecate passing nodes to op constructor (#7327)
Browse files Browse the repository at this point in the history
* Add a warning

* Remove quotes

* Replace outputs with output(s)
  • Loading branch information
Bartosz Lesniewski authored Sep 7, 2021
1 parent 8eeee5e commit c568791
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ngraph/python/src/ngraph/utils/node_factory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

import logging as log

from functools import partial
from typing import Any, Dict, List, Optional, Union

Expand Down Expand Up @@ -82,6 +84,9 @@ def _arguments_as_outputs(arguments: List[Union[Node, Output]]) -> List[Output]:
if issubclass(type(argument), Output):
outputs.append(argument)
else:
log.warning("Op arguments were passed as Node, please avoid passing arguments in "
"this manner, and pass Output(s) instead, because accepting Nodes will "
"be deprecated in a future release.")
outputs.extend(argument.outputs())
return outputs

Expand Down

0 comments on commit c568791

Please sign in to comment.