code: def threshold_tuning(batch_predictions, threshold):
      """Post processing by finding a threshold
  
      Args:
          predictions torch.Tensor: (b, t, 4)
      """
      argmax_preds = torch.argmax(batch_predictions, dim=2)
      max, _ = torch.max(batch_predictions, dim=2)
      index = torch.gt(max, threshold)
      return torch.mul(index, argmax_preds)
  
file_path: speechbrain/recipes/ZaionEmotionDataset/emotion_diarization/train.py
imports: import os
  import sys
  import speechbrain
  from hyperpyyaml import load_hyperpyyaml
  import torch
  import json
  import itertools
  from speechbrain.utils.EDER import EDER
label_desc: Use image node_id 2 for calling a global function with example usage: threshold_tuning(batch_predictions, threshold) and returns: torch