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)
评论列表
文章目录