code: def allequal(tensor1, tensor2, **kwargs):
      """Returns True if two tensors are element-wise equal along a given axis.
  
      This function is equivalent to calling ``np.all(tensor1 == tensor2, **kwargs)``,
      but allows for ``tensor1`` and ``tensor2`` to differ in type.
  
      Args:
          tensor1 (tensor_like): tensor to compare
          tensor2 (tensor_like): tensor to compare
          **kwargs: Accepts any keyword argument that is accepted by ``np.all``,
              such as ``axis``, ``out``, and ``keepdims``. See the `NumPy documentation
              <https://numpy.org/doc/stable/reference/generated/numpy.all.html>`__ for
              more details.
  
      Returns:
          ndarray, bool: If ``axis=None``, a logical AND reduction is applied to all elements
          and a boolean will be returned, indicating if all elements evaluate to ``True``. Otherwise,
          a boolean NumPy array will be returned.
  
      **Example**
  
      >>> a = torch.tensor([1, 2])
      >>> b = np.array([1, 2])
      >>> allequal(a, b)
      True
      """
      t1 = ar.to_numpy(tensor1)
      t2 = ar.to_numpy(tensor2)
      return np.all(t1 == t2, **kwargs)
  
file_path: pennylane/pennylane/math/utils.py
imports: import warnings
  import autoray
  import numpy
  from autograd.numpy.numpy_boxes import ArrayBox
  from autoray import numpy
  from .None import single_dispatch
label_desc: Use image node_id 1 for calling a global function with example usage: allequal(tensor1, tensor2) and returns: np