code: def cost(self, logit, label, weight):
      loss = []
      for i in range(logit.size()[0]):
          loss.append(
              torch.nn.functional.cross_entropy(
                  logit[i, :], label[i].long()
              ).mul(weight[i])
          )
      loss = torch.cat(loss).mean()
      return loss
  
file_path: deepchem/contrib/torch/torch_multitask_classification.py
imports: import torch
  import numpy
  from deepchem.metrics import from_one_hot
  from torch_model import TorchMultitaskModel
label_desc: Use image node_id 4 for calling the TorchMultitaskClassification obj's underlying member method code with example usage: obj.cost(logit, label, weight) and returns: loss