result_types.py 文件源码

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

项目:fold 作者: tensorflow 项目源码 文件源码
def __init__(self, shape, dtype='float32'):
    """Creates a tensor type.

    Args:
      shape: A tuple or list of non-negative integers.
      dtype: A `tf.DType`, or stringified version thereof (e.g. `'int64'`).

    Raises:
      TypeError: If `shape` is not a tuple or list of non-negative integers.
      TypeError: If `dtype` cannot be converted to a TF dtype.
    """
    if not isinstance(shape, (tuple, list)):
      raise TypeError('shape must be a tuple or list: %s' % str(shape))
    self._type_shape = loom.TypeShape(dtype, shape)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号