code: def _validate_model_outputs(
      predictions: torch.Tensor,
      labels: torch.Tensor,
      weights: torch.Tensor,
      session_ids: torch.Tensor,
  ) -> None:
      assert (
          predictions.shape
          == labels.shape
          == weights.shape
          == session_ids.shape
      )
      assert (
          predictions.dim() == 2
          and predictions.shape[0] > 0
          and predictions.shape[1] > 0
      )
  
imports: from typing import Any, cast, Dict, List, Optional, Type
  import torch
  from torch import distributed
  from torchrec.metrics.metrics_config import RecComputeMode, RecTaskInfo
  from torchrec.metrics.metrics_namespace import MetricName, MetricNamespace, MetricPrefix
  from torchrec.metrics.rec_metric import MetricComputationReport, RecMetric, RecMetricComputation, RecMetricException
label_desc: Use image node_id 5 for calling a global function with example usage: _validate_model_outputs(predictions, labels, weights, session_ids) without return types