code: def rotate_half(x):
      """Rotates half the hidden dims of the input."""
      x1 = x[..., : x.shape[-1] // 2]
      x2 = x[..., x.shape[-1] // 2 :]
      return torch.cat((-x2, x1), dim=-1)
  
imports: import math
  from typing import Optional
  import pytest
  import torch
  import torch.utils.checkpoint
  from helpers import assert_similar, random_tensor
  from torch import nn
  from quanto import Calibration, quantize
label_desc: Use image node_id 1 for calling a global function with example usage: rotate_half(x) and returns: torch