code: def _setdiff1d(a, b, aminusb=True, validate_indices=True):
      """Compute set difference of elements in last dimension of `a` and `b`."""
      if not aminusb:
          raise NotImplementedError(
              "Argument `aminusb != True` is currently unimplemented."
          )
      if not validate_indices:
          raise NotImplementedError(
              "Argument `validate_indices != True` is currently unimplemented."
          )
      with tf.name_scope("setdiff1d"):
          dtype = dtype_util.as_numpy_dtype(
              dtype_util.common_dtype([a, b], dtype_hint=tf.int32)
          )
          a_ = tf.get_static_value(a)
          b_ = tf.get_static_value(b)
          if a_ is None or b_ is None:
              a = tf.convert_to_tensor(a, dtype=dtype, name="a")
              b = tf.convert_to_tensor(b, dtype=dtype, name="b")
              return tf.sparse.to_dense(
                  tf.sets.difference(a[tf.newaxis], b[tf.newaxis])
              )[0]
          a_ = np.array(a_, dtype=dtype)
          b_ = np.array(b_, dtype=dtype)
          # TODO(https://github.com/google/jax/issues/70): Jax lacks setdiff1d
          return np.setdiff1d(a_, b_)
  
imports: import decorator
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal.backend import numpy
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import control_flow_case
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 18 for calling a global function with example usage: _setdiff1d(a, b, aminusb, validate_indices) and returns: np, tf