code: def testComplex(self):
      inputs = [
          0,
          1,
          -1,
          0.5,
          0.25,
          0.125,
          complex("INF"),
          complex("NAN"),
          complex("-INF"),
      ]
      complex_inputs_ = [(x + (x + 1) * 1j) for x in inputs]
  
      for dtype in (dtypes.complex64, dtypes.complex128):
          inputs = ops.convert_to_tensor(complex_inputs_, dtype=dtype)
  
          def clean_nans(s_l):
              return [
                  s.decode("ascii").replace("-nan", "nan")
                  for s in self.evaluate(s_l)
              ]
  
          result = string_ops.as_string(inputs, shortest=True)
          self.assertAllEqual(
              clean_nans(result),
              ["(%g,%g)" % (x.real, x.imag) for x in complex_inputs_],
          )
  
          result = string_ops.as_string(inputs, scientific=True)
          self.assertAllEqual(
              clean_nans(result),
              ["(%e,%e)" % (x.real, x.imag) for x in complex_inputs_],
          )
  
          result = string_ops.as_string(inputs)
          self.assertAllEqual(
              clean_nans(result),
              ["(%f,%f)" % (x.real, x.imag) for x in complex_inputs_],
          )
  
          result = string_ops.as_string(inputs, width=3)
          self.assertAllEqual(
              clean_nans(result),
              [
                  "(%03f,%03f)" % (x.real, x.imag)
                  for x in complex_inputs_
              ],
          )
  
          result = string_ops.as_string(
              inputs, width=3, fill="0", shortest=True
          )
          self.assertAllEqual(
              clean_nans(result),
              [
                  "(%03g,%03g)" % (x.real, x.imag)
                  for x in complex_inputs_
              ],
          )
  
          result = string_ops.as_string(inputs, precision=10, width=3)
          self.assertAllEqual(
              clean_nans(result),
              [
                  "(%03.10f,%03.10f)" % (x.real, x.imag)
                  for x in complex_inputs_
              ],
          )
  
          result = string_ops.as_string(
              inputs, precision=10, width=3, fill="0", shortest=True
          )
          self.assertAllEqual(
              clean_nans(result),
              [
                  "(%03.10g,%03.10g)" % (x.real, x.imag)
                  for x in complex_inputs_
              ],
          )
  
      with self.assertRaisesOpError("Cannot select both"):
          self.evaluate(
              string_ops.as_string(
                  inputs, scientific=True, shortest=True
              )
          )
  
file_path: tensorflow/tensorflow/python/kernel_tests/strings_ops/as_string_op_test.py
imports: import numpy
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import string_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 6 for calling the AsStringOpTest obj's underlying member method code with example usage: obj.testComplex() and returns: unknown