TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

View source on GitHub

Runs the program with an optional main function and argv list.

The program will run with eager execution enabled.


import tensorflow as tf
# Import subject to future changes:
from tensorflow.contrib.eager.python import tfe

def main(_):
  u = tf.constant(6.0)
  v = tf.constant(7.0)
  print(u * v)

if __name__ == "__main__":


  • main: the main function to run.
  • argv: the arguments to pass to it.