class_docstr: Stores hyperparameters for initialization, batch norm and training.
class_docstr_tok: ["Stores","hyperparameters","for","initialization",",","batch","norm","and","training","."]
docstr: Check that all the pitch range related hparams match each other.
docstr_tok: ["Check","that","all","the","pitch","range","related","hparams","match","each","other","."]
code: def _check_pitch_range_compatibilities(self, legacy_hparams, dikt):
      """Check that all the pitch range related hparams match each other."""
      min_pitch = dikt.get("min_pitch", self.min_pitch)
      max_pitch = dikt.get("max_pitch", self.max_pitch)
      if "pitch_ranges" in legacy_hparams:
          for legacy_pitch, given_pitch in zip(
              legacy_hparams["pitch_ranges"], [min_pitch, max_pitch]
          ):
              if legacy_pitch != given_pitch:
                  raise ValueError(
                      "Legacy pitch range element %d does not match given "
                      "pitch %d." % (legacy_pitch, given_pitch)
                  )
      if "num_pitches" in legacy_hparams:
          computed_num_pitches = max_pitch - min_pitch + 1
          legacy_num_pitches = legacy_hparams["num_pitches"]
          if legacy_num_pitches != computed_num_pitches:
              raise ValueError(
                  "num_pitches %d is not compatible with that computed from "
                  "min_pitch %d and max_pitch %d, which is %d."
                  % (
                      legacy_num_pitches,
                      min_pitch,
                      max_pitch,
                      computed_num_pitches,
                  )
              )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  import os
  from magenta.models.coconet import lib_util
  import numpy
  import six
  import tensorflow.compat.v1
  import yaml
label_desc: Use image node_id 4 for calling the Hyperparameters obj's underlying member method code with example usage: obj._check_pitch_range_compatibilities(legacy_hparams, dikt) without return types