code: def _validate_model_outputs(
      labels: torch.Tensor,
      predictions: torch.Tensor,
      weights: torch.Tensor,
      sessions: torch.Tensor,
  ) -> None:
      # check if tensors are of the same shape
      assert labels.dim() == 2
      assert labels.shape == predictions.shape
      assert labels.shape == weights.shape
      assert labels.shape == sessions.shape
  
imports: import logging
  from typing import Any, cast, Dict, List, Optional, Set, Type, Union
  import torch
  from torch import distributed
  from torchrec.metrics.metrics_config import RecTaskInfo, SessionMetricDef
  from torchrec.metrics.metrics_namespace import MetricName, MetricNamespace, MetricPrefix
  from torchrec.metrics.rec_metric import MetricComputationReport, RecComputeMode, RecMetric, RecMetricComputation, RecMetricException
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_model_outputs(labels, predictions, weights, sessions) without return types