docstr: Tests that the dense layer node is properly compiled in jit scope.
  
  Dense layer with static shape input tensor should be compiled into a single
  XlaCompile/XlaRun op pair by XLA.
docstr_tok: ["Tests","that","the","dense","layer","node","is","properly","compiled","in","jit","scope",".","Dense","layer","with","static","shape","input","tensor","should","be","compiled","into","a","single","XlaCompile\/XlaRun","op","pair","by","XLA","."]
code: def testDenseLayerJitScopeDefinedShape(self):
      """Tests that the dense layer node is properly compiled in jit scope.
  
      Dense layer with static shape input tensor should be compiled into a single
      XlaCompile/XlaRun op pair by XLA.
      """
  
      with self.session() as sess:
          x = array_ops.placeholder(shape=[2, 2, 3], dtype=np.float32)
          with jit_scope():
              y = layers.dense(x, 3)
  
          self.evaluate(variables.global_variables_initializer())
          run_metadata = config_pb2.RunMetadata()
          test_utils.RunWithWarmup(
              sess,
              y,
              {
                  x: np.array(
                      [[[1, 2, 3], [4, 5, 6]], [[1, 2, 3], [4, 5, 6]]]
                  )
              },
              run_metadata=run_metadata,
              options=config_pb2.RunOptions(
                  trace_level=config_pb2.RunOptions.FULL_TRACE
              ),
          )
  
      labels = GetRunMetadataLabels(run_metadata)
      self.assertEqual(1, self.countXlaOps(labels))
  
file_path: tensorflow/tensorflow/compiler/tests/dense_layer_test.py
imports: import os
  import numpy
  from tensorflow.compiler.tests import test_utils
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.compiler.xla import jit
  from tensorflow.python.framework import ops
  from tensorflow.python.layers import layers
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the DenseLayerTest obj's underlying member method code with example usage: obj.testDenseLayerJitScopeDefinedShape() without return types