code: def _compress_uint8_to_uint4(self, tensor: Tensor) -> Tensor:
      assert tensor.shape[-1] % 2 == 0
  
      new_data_shape = list(tensor.shape)
      new_data_shape[-1] = new_data_shape[-1] // 2
  
      data = torch.empty(
          new_data_shape, dtype=torch.uint8, device=tensor.device
      )
      data = torch.bitwise_or(
          tensor[..., 0::2].bitwise_left_shift(4), tensor[..., 1::2]
      )
  
      return data
  
imports: import torch
  import deepspeed
  from torch import Tensor
  from typing import Tuple
  import torch.nn
  from typing import Dict, Callable, Union
  from deepspeed.accelerator import get_accelerator
  import functools
label_desc: Use image node_id 4 for calling the Quantizer obj's underlying member method code with example usage: obj._compress_uint8_to_uint4(tensor) and returns: data