TensorFlow 4-d 张量

问题描述 投票:0回答:1

使用

tf.zeros
初始化大小为 10 x 256 x 256 x 3 的四维零张量。

images =  # TODO

assert isinstance(images, tf.Tensor), "matrix must be a tf Tensor object"
assert tf.rank(images).numpy() == 4, "matrix must be of rank 4"
assert tf.shape(images).numpy().tolist() == [10, 256, 256, 3], "matrix is incorrect shape"
tensorflow tensor
1个回答
4
投票
images = tf.zeros(shape=[10, 256, 256, 3])

这是作业,对吧?

© www.soinside.com 2019 - 2024. All rights reserved.