"examples/vscode:/vscode.git/clone" did not exist on "bc1d28c88873bef8c44a5b42ba3a3db975cbb3e5"
Commit ba15af6e authored by Orion Reblitz-Richardson's avatar Orion Reblitz-Richardson
Browse files

Fix issue in neural_gpu.py where TypeError is raised.

* `python neural_gpu_trainer.py --task=rev` raises the following TypeError:

  File “..models/neural_gpu/neural_gpu.py", line 26, in conv_linear
    assert args
  File “..tensorflow/python/framework/ops.py", line 475, in __nonzero__
    raise TypeError("Using a `tf.Tensor` as a Python `bool` is not allowed. "
TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed. Use `if t is not None:` instead of `if t:` to test if a tensor is defined, and use the logical TensorFlow ops to test the value of a tensor.
parent 6406a152
...@@ -23,7 +23,7 @@ import data_utils ...@@ -23,7 +23,7 @@ import data_utils
def conv_linear(args, kw, kh, nin, nout, do_bias, bias_start, prefix): def conv_linear(args, kw, kh, nin, nout, do_bias, bias_start, prefix):
"""Convolutional linear map.""" """Convolutional linear map."""
assert args assert args is not None
if not isinstance(args, (list, tuple)): if not isinstance(args, (list, tuple)):
args = [args] args = [args]
with tf.variable_scope(prefix): with tf.variable_scope(prefix):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment