code: def cross_entropy_loss_with_soft_target(pred, soft_target):
      logsoftmax = nn.LogSoftmax()
      return torch.mean(torch.sum(-soft_target * logsoftmax(pred), 1))
  
file_path: nni/examples/nas/legacy/cream/lib/utils/util.py
imports: import sys
  import logging
  import torch
  import argparse
  import torch.nn
  from torch import optim
  from thop import profile, clever_format
  from timm.utils import *
  from lib.config import cfg
label_desc: Use image node_id 8 for calling a global function with example usage: cross_entropy_loss_with_soft_target(pred, soft_target) and returns: torch