message: Fix tests when `tf._major_api_version` does not exist
diff: @@ -74,7 +74,8 @@ class ModuleTest(test.TestCase):
  tf.summary.image
  # If we use v2 API, check for create_file_writer,
  # otherwise check for FileWriter.
  - if hasattr(tf, '_major_api_version') and tf._major_api_version == 2:
  + if hasattr(tf, '_major_api_version'):
  + if tf._major_api_version == 2:
  tf.summary.create_file_writer
  else:
  tf.summary.FileWriter
  @@ -82,6 +83,7 @@ class ModuleTest(test.TestCase):
  def testInternalKerasImport(self):
  normalization_parent = layers.BatchNormalization.__module__.split('.')[-1]
  + if hasattr(tf, '_major_api_version'):
  if tf._major_api_version == 2:
  self.assertEqual('normalization_v2', normalization_parent)
  self.assertTrue(layers.BatchNormalization._USE_V2_BEHAVIOR)
  