Python 使用带有子图的张量
对于上述代码中的Python 使用带有子图的张量,python,image,matplotlib,tensor,Python,Image,Matplotlib,Tensor,对于上述代码中的subfig,我获得了错误***AttributeError:“Tensor”对象没有带有行subfig.add\u image(my\u Tensor)的属性“set\u figure”我的张量是 fig, subfigs = pyplot.subplots(2, 2, tight_layout=True) for subfig in subfigs.reshape(-1): ... 事实上,它只是张量形式下的一幅图 我怎样才能解决这个问题?我会有兴趣添加图像,
subfig
,我获得了错误***AttributeError:“Tensor”对象没有带有行subfig.add\u image(my\u Tensor)
的属性“set\u figure”
<代码>我的张量是
fig, subfigs = pyplot.subplots(2, 2, tight_layout=True)
for subfig in subfigs.reshape(-1):
...
事实上,它只是张量形式下的一幅图
我怎样才能解决这个问题?我会有兴趣添加图像,但我不知道如何做到这一点
tensor([[[ 0.2163, -0.4846, -0.7962, ..., -0.7962, -0.3678, -0.0952],
[ 0.2163, 0.0216, -0.6404, ..., -0.6404, -0.1341, -0.0563],
[-0.5625, 0.0216, 0.4889, ..., 0.0216, -0.7572, -0.9909],
...,
[-1.4582, -1.1856, -1.0688, ..., -0.3289, -0.5625, -1.1856],
[-0.7572, -0.8741, -1.1856, ..., -0.8741, -1.3414, -0.7183],
[-0.5625, -1.0298, -1.4582, ..., -0.6793, -0.5236, -0.4457]]])