class_docstr: An attention layer that allows for downscaling the size of the embedding after projection to queries, keys,
  and values.
class_docstr_tok: ["An","attention","layer","that","allows","for","downscaling","the","size","of","the","embedding","after","projection","to","queries",",","keys",",","and","values","."]
code: def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor:
      b, n, c = x.shape
      x = x.reshape(b, n, num_heads, c // num_heads)
      return x.transpose(1, 2)
  
imports: from __future__ import annotations
  import math
  from torch import nn
  from kornia.contrib.models.sam.architecture.common import MLPBlock
  from kornia.core import Module, Tensor
  from kornia.core.check import KORNIA_CHECK
label_desc: Use image node_id 2 for calling the Attention obj's underlying member method code with example usage: obj._separate_heads(x, num_heads) and returns: x