class_docstr: A wrapper for a function owned by an EagerPyFunc.
class_docstr_tok: ["A","wrapper","for","a","function","owned","by","an","EagerPyFunc","."]
docstr: Passes `args` to `self._func`, which is executed eagerly.
code: def _call(self, device, args):
      """Passes `args` to `self._func`, which is executed eagerly."""
      with context.eager_mode():
          ret = self._func(*args)
          # copy the returned tensors to the PyFunc op's device if necessary.
          device_name = device
          if device_name is None:
              # "None" here means "CPU", from the nullptr convention with C++ device
              # pointers.
              device_name = (
                  "/job:localhost/replica:0/task:0/device:CPU:0"
              )
          with ops.device(device):
              if isinstance(ret, (tuple, list)):
                  outputs = [
                      _maybe_copy_to_context_device(
                          self._convert(x, dtype=dtype), device_name
                      )
                      for (x, dtype) in zip(ret, self._out_dtypes)
                  ]
              elif ret is None:
                  outputs = None
              else:
                  outputs = _maybe_copy_to_context_device(
                      self._convert(ret, dtype=self._out_dtypes[0]),
                      device_name,
                  )
      return outputs
  
imports: import functools
  import threading
  import traceback
  import weakref
  import numpy
  from tensorflow.python.autograph.impl import api
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import backprop_util
  from tensorflow.python.eager import context
  from tensorflow.python.eager import record
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import func_graph
  from tensorflow.python.framework import function
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import type_spec
  from tensorflow.python.lib.core import _pywrap_py_func
  from tensorflow.python.ops import autograph_ops
  from tensorflow.python.ops import gen_script_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.util import compat
  from tensorflow.python.util import deprecation
  from tensorflow.python.util import dispatch
  from tensorflow.python.util import nest
  from tensorflow.python.util import tf_inspect
  from tensorflow.python.util import variable_utils
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 5 for calling the EagerFunc obj's underlying member method code with example usage: obj._call(device, args) and returns: outputs