code: def certify_inputs(log_probs, labels, lengths, label_lengths):
      # check_type(log_probs, torch.float32, "log_probs")
      check_type(labels, torch.int64, "labels")
      check_type(label_lengths, torch.int64, "label_lengths")
      check_type(lengths, torch.int64, "lengths")
      check_contiguous(log_probs, "log_probs")
      check_contiguous(labels, "labels")
      check_contiguous(label_lengths, "label_lengths")
      check_contiguous(lengths, "lengths")
  
      if lengths.shape[0] != log_probs.shape[0]:
          raise ValueError(
              f"Must have a length per example. "
              f"Given lengths dim: {lengths.shape[0]}, "
              f"Log probs dim : {log_probs.shape[0]}"
          )
      if label_lengths.shape[0] != log_probs.shape[0]:
          raise ValueError(
              "Must have a label length per example. "
              f"Given label lengths dim : {label_lengths.shape[0]}, "
              f"Log probs dim : {log_probs.shape[0]}"
          )
  
      check_dim(log_probs, 4, "log_probs")
      check_dim(labels, 2, "labels")
      check_dim(lengths, 1, "lenghts")
      check_dim(label_lengths, 1, "label_lenghts")
      max_T = torch.max(lengths)
      max_U = torch.max(label_lengths)
      T, U = log_probs.shape[1:3]
      if T != max_T:
          raise ValueError(
              f"Input length mismatch! Given T: {T}, Expected max T from input lengths: {max_T}"
          )
      if U != max_U + 1:
          raise ValueError(
              f"Output length mismatch! Given U: {U}, Expected max U from target lengths: {max_U} + 1"
          )
  
imports: import numpy
  import torch
  from torch.autograd import Function, Variable
  from torch.nn import Module
label_desc: Use image node_id 4 for calling a global function with example usage: certify_inputs(log_probs, labels, lengths, label_lengths) without return types