class_docstr: The implements the loss function for models that use a dc.models.losses.Loss.
class_docstr_tok: ["The","implements","the","loss","function","for","models","that","use","a","dc.models.losses.Loss","."]
code: def __init__(self, model: TorchModel, loss: Loss) -> None:
      self.model = model
      self.loss = loss  # not used
      self.criterion = loss._create_pytorch_loss()
  
imports: import numpy
  import torch
  import time
  import logging
  import os
  import datetime
  from deepchem.data import Dataset, NumpyDataset
  from deepchem.metrics import Metric
  from deepchem.models.losses import Loss
  from deepchem.models.models import Model
  from deepchem.models.optimizers import Adam, Optimizer, LearningRateSchedule
  from deepchem.trans import Transformer, undo_transforms
  from deepchem.utils.evaluate import GeneratorEvaluator
  from collections.abc import Sequence
  from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, Union
  from deepchem.utils.typing import LossFn, OneOrMany
  from deepchem.models.wandblogger import WandbLogger
label_desc: Use image node_id 1 to create a new _StandardLoss object from inherited base classes: object with example: obj = _StandardLoss(model, loss)