class_docstr: Tests for recognizable export signatures from concrete functions.
class_docstr_tok: ["Tests","for","recognizable","export","signatures","from","concrete","functions","."]
code: def testMethod(self):
      class HasMethod(object):
          @polymorphic_function.function
          def method(self, x):
              return x
  
      has_method = HasMethod()
      # Call the function to make def_function happy
      HasMethod.method(has_method, array_ops.ones([]))
      class_op = HasMethod.method.get_concrete_function(
          has_method,
          tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32),
      )
      self.assertEqual(["x"], [inp.op.name for inp in class_op.inputs])
      self.assertEqual(
          [b"x"],
          [
              inp.op.get_attr("_user_specified_name")
              for inp in class_op.inputs
          ],
      )
      # Call the function to make def_function happy
      has_method.method(array_ops.ones([]))
      method_op = has_method.method.get_concrete_function(
          tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32)
      )
      self.assertEqual(["x"], [inp.op.name for inp in method_op.inputs])
      self.assertEqual(
          [b"x"],
          [
              inp.op.get_attr("_user_specified_name")
              for inp in method_op.inputs
          ],
      )
      # TODO(allenl): It should be possible to override names when exporting. Do
      # TensorSpec names need to go in cache keys? Or maybe get_concrete_function
      # should always retrace?
      self.skipTest("Not working")
      method_op = has_method.method.get_concrete_function(
          tensor_spec.TensorSpec(
              shape=(), dtype=dtypes.float32, name="y"
          )
      )
      self.assertEqual(["y"], [inp.op.name for inp in method_op.inputs])
      self.assertEqual(
          [b"y"],
          [
              inp.op.get_attr("_user_specified_name")
              for inp in method_op.inputs
          ],
      )
  
imports: from absl.testing import parameterized
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.eager.polymorphic_function import polymorphic_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 4 for calling the ArgumentNamingTests obj's underlying member method code with example usage: obj.testMethod() and returns: x