dataset_schema.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:transform 作者: tensorflow 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号