class_docstr: Helper class to manage losses.
class_docstr_tok: ["Helper","class","to","manage","losses","."]
docstr: Get R, D part of loss.
docstr_tok: ["Get","R",",","D","part","of","loss","."]
code: def get_rd_loss(self, distortion_loss, bpp_pair: BppPair, step):
      """Get R, D part of loss."""
      loss_config = self._config.loss_config
  
      weighted_distortion_loss = self._get_weighted_distortion_loss(
          loss_config, distortion_loss
      )
      weighted_rate = self._get_weighted_rate_loss(
          loss_config, bpp_pair, step
      )
  
      tf.summary.scalar("components/weighted_R", weighted_rate)
      tf.summary.scalar(
          "components/weighted_D", weighted_distortion_loss
      )
  
      return weighted_rate + weighted_distortion_loss
  
imports: import collections
  import glob
  import itertools
  from compare_gan.gans import loss_lib
  import tensorflow.compat.v1
  import tensorflow_datasets
  from hific import archs
  from hific import helpers
  from hific.helpers import ModelMode
  from hific.helpers import ModelType
  from hific.helpers import TFDSArguments
label_desc: Use image node_id 2 for calling the _LossScaler obj's underlying member method code with example usage: obj.get_rd_loss(distortion_loss, bpp_pair, step) and returns: unknown