code: def compute_cmc_loss(
      cyc_consistency_loss,
      loss_weight,
      clip_emb_reshape,
      clip_emb_mask,
      clip_emb_lens,
      sent_emb_reshape,
      sent_emb_mask,
      sent_emb_lens,
  ):
      """Calculate the total cycle consistency loss between video clips and paragraph sentences
  
      Args:
          cyc_consistency_loss (loss function): cycle consistency loss function
          loss_weight (float): weight of loss
          clip_emb_reshape
          clip_emb_mask
          clip_emb_lens
          sent_emb_reshape
          sent_emb_mask
          sent_emb_lens
  
      Returns:
          total loss
      """
      clip_clip_loss, sent_sent_loss = cyc_consistency_loss(
          clip_emb_reshape,
          clip_emb_mask,
          clip_emb_lens,
          sent_emb_reshape,
          sent_emb_mask,
          sent_emb_lens,
      )
      loss = loss_weight * (clip_clip_loss + sent_sent_loss)
      return loss
  
imports: import ctypes
  import datetime
  import logging
  import multiprocessing
  import os
  from pathlib import Path
  import random
  import sys
  from typing import Tuple, Dict
  import numpy
  import torch
  import torch.backends.cudnn
  from torch import cuda
  import torch.nn.functional
label_desc: Use image node_id 20 for calling a global function with example usage: compute_cmc_loss(cyc_consistency_loss, loss_weight, clip_emb_reshape, clip_emb_mask, clip_emb_lens, sent_emb_reshape, sent_emb_mask, sent_emb_lens) and returns: loss