Skip to content

Commit d523a6d

Browse files
committed
fix is tensor
1 parent 4e61852 commit d523a6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensorlayer/models/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def __init__(self, inputs=None, outputs=None, name=None):
210210
# check type of inputs and outputs
211211
check_order = ['inputs', 'outputs']
212212
for co, check_argu in enumerate([inputs, outputs]):
213-
if isinstance(check_argu, [tf.Tensor, tf.SparseTensor, tf.Variable]) or tf_ops.is_dense_tensor_like(check_argu):
213+
if isinstance(check_argu, (tf.Tensor, tf.SparseTensor, tf.Variable)) or tf_ops.is_dense_tensor_like(check_argu):
214214
pass
215215
elif isinstance(check_argu, list):
216216
if len(check_argu) == 0:
@@ -219,7 +219,7 @@ def __init__(self, inputs=None, outputs=None, name=None):
219219
"It should be either Tensor or a list of Tensor."
220220
)
221221
for idx in range(len(check_argu)):
222-
if not isinstance(check_argu[idx], [tf.Tensor, tf.SparseTensor, tf.Variable]) or not tf_ops.is_dense_tensor_like(
222+
if not isinstance(check_argu[idx], (tf.Tensor, tf.SparseTensor, tf.Variable)) or not tf_ops.is_dense_tensor_like(
223223
check_argu[idx]):
224224
raise TypeError(
225225
"The argument `%s` should be either Tensor or a list of Tensor " % (check_order[co]) +

0 commit comments

Comments
 (0)