Suggested Change to Advanced Tutorials, tf$ones arguments
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 48/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- r, tensorflow
- Domain
- documentation
Research direction
Open the Advanced Tutorials section on R array compatibility at the linked tensors and operations page and compare the current tf$ones example with the reported error. Update the tutorial example to the working syntax shown in the issue, then verify that it produces the expected TensorFlow output.
Written by the indexing model from the issue text.
Description
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)
- Dominant language
- R
- Stars
- 1.3k
- Forks
- 316
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rstudio/tensorflow
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
rstudio/tensorflow#625 · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
rstudio/tensorflow#622 · 7 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
rstudio/tensorflow#620 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
rstudio/tensorflow#611 · 4 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
rstudio/tensorflow#605 · 2 comments ·
All issues in rstudio/tensorflow
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·