def testDTypesHaveUniqueNames(self): dtypes = [] names = set() for datatype_enum in types_pb2.DataType.values(): if datatype_enum == types_pb2.DT_INVALID: continue dtype = tf.as_dtype(datatype_enum) dtypes.append(dtype) names.add(dtype.name) self.assertEqual(len(dtypes), len(names))