class_docstr: Base class to represent a Quaternion.
  
  A quaternion is a four dimensional vector representation of a rotation transformation in 3d.
  See more: https://en.wikipedia.org/wiki/Quaternion
  
  The general definition of a quaternion is given by:
  
  .. math::
  
      Q = a + b \cdot \mathbf{i} + c \cdot \mathbf{j} + d \cdot \mathbf{k}
  
  Thus, we represent a rotation quaternion as a contiguous tensor structure to
  perform rigid bodies transformations:
  
  .. math::
  
      Q = \begin{bmatrix} q_w & q_x & q_y & q_z \end{bmatrix}
  
  Example:
      >>> q = Quaternion.identity(batch_size=4)
      >>> q.data
      Parameter containing:
      tensor([[1., 0., 0., 0.],
              [1., 0., 0., 0.],
              [1., 0., 0., 0.],
              [1., 0., 0., 0.]], requires_grad=True)
      >>> q.real
      tensor([1., 1., 1., 1.], grad_fn=<SelectBackward0>)
      >>> q.vec
      tensor([[0., 0., 0.],
              [0., 0., 0.],
              [0., 0., 0.],
              [0., 0., 0.]], grad_fn=<SliceBackward0>)
class_docstr_tok: ["Base","class","to","represent","a","Quaternion",".","A","quaternion","is","a","four","dimensional","vector","representation","of","a","rotation","transformation","in","3d",".","See","more",":","https",":","\/\/en.wikipedia.org\/wiki\/Quaternion","The","general","definition","of","a","quaternion","is","given","by",":","..","math",":",":","Q","=","a","+","b","\\cdot","\\mathbf","{","i","}","+","c","\\cdot","\\mathbf","{","j","}","+","d","\\cdot","\\mathbf","{","k","}","Thus",",","we","represent","a","rotation","quaternion","as","a","contiguous","tensor","structure","to","perform","rigid","bodies","transformations",":","..","math",":",":","Q","=","\\begin","{","bmatrix","}","q_w","&","q_x","&","q_y","&","q_z","\\end","{","bmatrix","}","Example",":",">",">",">","q","=","Quaternion.identity","(","batch_size=4",")",">",">",">","q.data","Parameter","containing",":","tensor","(","[","[","1.",",","0.",",","0.",",","0",".","]",",","[","1.",",","0.",",","0.",",","0",".","]",",","[","1.",",","0.",",","0.",",","0",".","]",",","[","1.",",","0.",",","0.",",","0",".","]","]",",","requires_grad=True",")",">",">",">","q.real","tensor","(","[","1.",",","1.",",","1.",",","1",".","]",",","grad_fn=","<","SelectBackward0",">",")",">",">",">","q.vec","tensor","(","[","[","0.",",","0.",",","0",".","]",",","[","0.",",","0.",",","0",".","]",",","[","0.",",","0.",",","0",".","]",",","[","0.",",","0.",",","0",".","]","]",",","grad_fn=","<","SliceBackward0",">",")"]
docstr: Return the underlying data with shape :math:`(B, 4)`.
  
  Alias for :func:`~kornia.geometry.quaternion.Quaternion.data`
code: def q(self) -> Tensor:
      """Return the underlying data with shape :math:`(B, 4)`.
  
      Alias for :func:`~kornia.geometry.quaternion.Quaternion.data`
      """
      return self.data
  
imports: from math import pi
  from typing import Optional, Tuple, Union
  from kornia.core import Device, Dtype, Module, Parameter, Tensor, concatenate, rand, stack, tensor, where
  from kornia.core.check import KORNIA_CHECK_TYPE
  from kornia.geometry.conversions import axis_angle_to_quaternion, euler_from_quaternion, normalize_quaternion, quaternion_from_euler, quaternion_to_rotation_matrix, rotation_matrix_to_quaternion
  from kornia.geometry.linalg import batched_dot_product
label_desc: Use image node_id 15 for calling the Quaternion obj's underlying member method code with example usage: obj.q() and returns: self