class_docstr: Tests for ops in horovod.tensorflow.keras.
class_docstr_tok: ["Tests","for","ops","in","horovod.tensorflow.keras","."]
code: def _check_optimizer_weights(self, opt, new_opt):
      self.assertEqual(len(opt.variables()), len(new_opt.variables()))
      for weights, new_weights in zip(
          opt.variables(), new_opt.variables()
      ):
          if np.isscalar(weights):
              self.assertEqual(weights, new_weights)
          else:
              self.assertListEqual(
                  weights.tolist(), new_weights.tolist()
              )
  
imports: import math
  import numpy
  import os
  import pytest
  import sys
  import tensorflow
  import warnings
  from packaging import version
  from tensorflow import keras
  from horovod.common.util import is_version_greater_equal_than
  import horovod.tensorflow.keras
  from common import temppath
label_desc: Use image node_id 10 for calling the TfKerasTests obj's underlying member method code with example usage: obj._check_optimizer_weights(opt, new_opt) without return types