view_function_graph: Visualizes the generated graph

View source: R/view.R

view_function_graphR Documentation

Visualizes the generated graph

Description

Visualizes the generated graph

Usage

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

## 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)

t-kalinowski/tfautograph documentation built on May 16, 2023, 8:05 a.m.