Skip to content

Commit

Permalink
fix tensor construtor (#4522)
Browse files Browse the repository at this point in the history
* fix construtor

* fix construtor

Co-authored-by: oneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
  • Loading branch information
poohRui and oneflow-ci-bot authored Mar 26, 2021
1 parent bb4a310 commit 54d069f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oneflow/python/framework/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ def __init__(
dtype = dtype if dtype is not None else oneflow_api.float32
if placement is None:
device = device if device is not None else oneflow_api.device("cpu")
if _input_args_is_tensor:
if _input_args_is_tensor(*args):
TODO() # liyurui, construct using another tensor
elif _input_args_is_consistent_or_local:
elif _input_args_is_consistent_or_local(*args):
self._local_or_consistent_tensor = args[0]
self._undetermined_tensor = None
elif _input_args_is_data:
elif _input_args_is_data(*args):
self._local_or_consistent_tensor = None
self._construct_with_data(
*args,
Expand Down

0 comments on commit 54d069f

Please sign in to comment.