class_docstr: Tests the Python interface to recomputation rewrites.
  
  See core/grappler/optimizers/memory_optimizer_test.cc for functional tests.
class_docstr_tok: ["Tests","the","Python","interface","to","recomputation","rewrites",".","See","core\/grappler\/optimizers\/memory_optimizer_test.cc","for","functional","tests","."]
docstr: A simple layered graph with conv, an intermediate op, and a ReLU.
docstr_tok: ["A","simple","layered","graph","with","conv",",","an","intermediate","op",",","and","a","ReLU","."]
code: def _GetMetaGraph(
      self, batch_size=14, image_dim=12, optimizer_scope_name=""
  ):
      """A simple layered graph with conv, an intermediate op, and a ReLU."""
      graph = ops.Graph()
      with graph.as_default():
          random_seed.set_random_seed(1)
          current_activation = variable_scope.get_variable(
              name="start", shape=[batch_size, image_dim, image_dim, 5]
          )
          conv_filter = variable_scope.get_variable(
              name="filter", shape=[5, 5, 5, 5]
          )
          for layer_number in range(10):
              with variable_scope.variable_scope(
                  "layer_{}".format(layer_number)
              ):
                  after_conv = nn.conv2d(
                      current_activation,
                      conv_filter,
                      [1, 1, 1, 1],
                      "SAME",
                  )
                  current_activation = 2.0 * after_conv
                  current_activation = nn.relu(current_activation)
          loss = math_ops.reduce_mean(current_activation)
          with ops.name_scope(optimizer_scope_name):
              optimizer = train.AdamOptimizer(0.001)
              train_op = optimizer.minimize(loss)
          init_op = variables.global_variables_initializer()
          metagraph = train.export_meta_graph()
      return (metagraph, init_op.name, train_op.name, loss.name)
  
imports: from tensorflow.core.framework import attr_value_pb2
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import meta_graph
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.framework import test_util
  from tensorflow.python.grappler import tf_optimizer
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variable_v1
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.training import training
label_desc: Use image node_id 1 for calling the MemoryOptimizerRecomputeTest obj's underlying member method code with example usage: obj._GetMetaGraph(batch_size, image_dim, optimizer_scope_name) and returns: metagraph,  init_op,  train_op,  loss