def __init__(self, dtype, min_value=None, max_value=None,
is_categorical=None, vocabulary_file=''):
super(IntDomain, self).__init__(dtype)
if not self.dtype.is_integer:
raise ValueError('IntDomain must be initialized with an integral dtype.')
# NOTE: Because there is no uint64 or 128 bit ints, the following values
# are always in the int64 range, which is important for the proto
# representation.
self._min_value = min_value if min_value is not None else self.dtype.min
self._max_value = max_value if max_value is not None else self.dtype.max
# Parsing a non-existing value from JSON will return None make sure it is
# translated to False.
self._is_categorical = (is_categorical
if is_categorical is not None
else False)
self._vocabulary_file = vocabulary_file
评论列表
文章目录