Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested Change to Advanced Tutorials, tf$ones arguments #528

Open
jonathan-nathan-aus opened this issue May 1, 2022 · 0 comments
Open

Comments

@jonathan-nathan-aus
Copy link

Hi Team,

I have been continuing my journey through the tutorials, and have come across an issue in the advanced tutorials, r array compatibility
.

It appears that the syntax currently in the tutorials used for the tf$ones operation seems to be outdated and needs to be updated to 1+tf$ones(shape(1)).

The current code and error output I get is:

> # TensorFlow operations convert arrays to Tensors automatically
> 1 + tf$ones(shape = 1)
Error in py_call_impl(callable, dots$args, dots$keywords) : 
  TypeError: Cannot convert 1.0 to EagerTensor of dtype int32

Detailed traceback:
  File "C:\PROGRA~3\ANACON~1\envs\R-RETI~1\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "C:\PROGRA~3\ANACON~1\envs\R-RETI~1\lib\site-packages\tensorflow\python\framework\constant_op.py", line 102, in convert_to_eager_tensor
    return ops.EagerTensor(value, ctx.device_name, dtype)

However, by adjusting the code from an example snippet from here, line 15 & 16 I get the correct output

> 1+tf$ones(shape(1))
tf.Tensor([2.], shape=(1), dtype=float32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant