tf_function and autograph

Open
#481 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
r, tensorflow

Research direction

Start with the Advanced Quickstart tutorial and R/eager.R lines 126-145, then compare the tutorial's tf_function(autograph(...)) usage with tf_function's autograph argument. Confirm the intended behavior for eager execution and document or update the example so the relationship between tf_function and autograph is unambiguous.

Written by the indexing model from the issue text.

Description

docs

from the advanced tutorial in Advanced Quickstart
the part of :

training_loop <- tf_function(autograph(function(train_ds, test_ds) {
  
  for (b1 in train_ds) {
    train_step(b1$x, b1$y)
  }
  
  for (b2 in test_ds) {
    test_step(b2$x, b2$y)
  }
  
  tf$print("Acc", train_accuracy$result(), "Test Acc", test_accuracy$result())
  
  train_loss$reset_states()
  train_accuracy$reset_states()
  test_loss$reset_states()
  test_accuracy$reset_states()
  
}))

can we just use tf_function with out the autograph function based on tf_function have argument to use autograph
see :
https://github.com/rstudio/tensorflow/blob/e3791c4dbd685e5f8788c1bf4902c7cc70dea477/R/eager.R#L126-L145
and use autograph function only in case of executing eagerly.

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rstudio/tensorflow

All issues in rstudio/tensorflow

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.