code: def quantize_tensor(self, weight):
      max_abs = torch.abs(weight).max()
      weight_normed = weight / max_abs
  
      weight_normed_expanded = weight_normed.unsqueeze(-1)
  
      # Reshape L to have the same number of dimensions as X_expanded
      L_reshaped = torch.tensor(self.norm_lookup_table).reshape(1, -1)
  
      # Calculate the absolute difference between X_expanded and L_reshaped
      abs_diff = torch.abs(weight_normed_expanded - L_reshaped)
  
      # Find the index of the minimum absolute difference for each element
      qweight = torch.argmin(abs_diff, dim=-1)
      return qweight, max_abs
  
file_path: peft/src/peft/utils/loftq_utils.py
imports: import logging
  from typing import Union
  import torch
  from peft.import_utils import is_bnb_4bit_available, is_bnb_available
label_desc: Use image node_id 4 for calling the NFQuantizer obj's underlying member method code with example usage: obj.quantize_tensor(weight) and returns: qweight,  max_abs