code: def compare_logits(
      logits_true: np.array, logits_hat: np.array, TOL: int = 0.3
  ):
      """
      Since logits {x_i} and logits {x_i + K} will result in the same probabilities {exp(x_i)/(sum_j exp(x_j))},
      one needs to apply softmax and inv_softmax before comparing logits within a certain tolerance
      """
      param_true = inv_softmax(softmax(logits_true, axis=-1))
      param_hat = inv_softmax(softmax(logits_hat, axis=-1))
      assert (
          np.abs(param_hat - param_true) < TOL * np.abs(param_true)
      ).all(), f"logits did not match: logits_true = {param_true}, logits_hat = {param_hat}"
  
imports: from typing import List
  import numpy
  import pytest
  import torch
  import torch.nn
  from scipy.special import softmax
  from torch.distributions import Beta, Gamma, NegativeBinomial, Normal, Poisson, StudentT
  from torch.nn.utils import clip_grad_norm_
  from torch.optim import SGD
  from torch.utils.data import DataLoader, TensorDataset
  from gluonts.pydantic import PositiveFloat, PositiveInt
  from gluonts.torch.distributions import BetaOutput, DistributionOutput, GammaOutput, NegativeBinomialOutput, NormalOutput, PoissonOutput, SplicedBinnedPareto, SplicedBinnedParetoOutput, StudentTOutput
label_desc: Use image node_id 4 for calling a global function with example usage: compare_logits(logits_true, logits_hat, TOL) without return types