class_docstr: Moment matching for multi-source domain adaptation (M3SDA).
  
  Reference:
      Peng, X., Bai, Q., Xia, X., Huang, Z., Saenko, K., & Wang, B. (2019). Moment matching for multi-source
      domain adaptation. In Proceedings of the IEEE/CVF International Conference on Computer Vision
      (pp. 1406-1415).
      https://openaccess.thecvf.com/content_ICCV_2019/html/Peng_Moment_Matching_for_Multi-Source_Domain_Adaptation_ICCV_2019_paper.html
code: def _compute_cls_loss(self, x, y, domain_labels: torch.Tensor):
      if len(y) == 0:
          return 0.0, 0.0
      else:
          cls_loss = 0.0
          ok_src = []
          n_src = 0
          for domain_ in self.domain_to_idx.keys():
              if domain_ == self.target_domain:
                  continue
              domain_idx = torch.where(
                  domain_labels == self.domain_to_idx[domain_]
              )[0]
              cls_output = self.classifiers[domain_](x[domain_idx])
              loss_cls_, ok_src_ = losses.cross_entropy_logits(
                  cls_output, y[domain_idx]
              )
              cls_loss += loss_cls_
              ok_src.append(ok_src_)
              n_src += 1
          cls_loss = cls_loss / n_src
          ok_src = torch.cat(ok_src)
          return cls_loss, ok_src
  
imports: import torch
  import torch.nn
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.metrics.pairwise import pairwise_kernels
  from sklearn.preprocessing import LabelBinarizer
  from torch.linalg import multi_dot
  from torch.nn.functional import one_hot
  import kale.predict.losses
  from kale.embed.image_cnn import _Bottleneck
  from kale.pipeline.domain_adapter import BaseAdaptTrainer
label_desc: Use image node_id 3 for calling the M3SDATrainer obj's underlying member method code with example usage: obj._compute_cls_loss(x, y, domain_labels) and returns: int,  int, cls_loss,  ok_src