view_function_graph: Visualizes the generated graph

Description Usage Arguments Examples

View source: R/view.R

Description

Visualizes the generated graph

Usage

1
2
3
4
5
6
7
8
9
view_function_graph(
  fn,
  args,
  ...,
  name = deparse(substitute(fn)),
  profiler = FALSE,
  concrete_fn = do.call(fn$get_concrete_fn, args),
  graph = concrete_fn$graph
)

Arguments

fn

TensorFlow function (returned from tf.function())

args

arguments passed to fun

...

other arguments passed to tensorflow::tensorboard()

name

string, provided to tensorboard

profiler

logical, passed on to tf.compat.v2.summary.trace_on() (only used in eager mode)

concrete_fn

a ConcreteFunction (only used in graph mode, ignored with a warning if executing eagerly)

graph

a tensorflow graph (only used in graph mode, ignored with a warning if executing eagerly)

Examples

1
2
3
4
5
## Not run: 
fn <- tf_function(function(x) autograph(if(x > 0) x * x else x))
view_function_graph(fn, list(tf$constant(5)))

## End(Not run)

tfautograph documentation built on Sept. 18, 2021, 1:07 a.m.