将张量的全部值打印到控制台中或写入张量流中的文件

Err*_*sum 5 numpy tensorflow

我需要在控制台中打印一个大张量([32,32,3]),并且我只会得到如下输出:

[[[245 245 245]
[245 245 245]
[245 245 245]
..., 
[245 245 245]
[245 245 245]
[245 245 245]]

[[245 245 245]
[245 245 245]
[245 245 245]
..., 
[245 245 245]
[245 245 245]
[245 245 245]]

[[245 245 245]
[245 245 245]
[245 245 245]
..., 
[245 245 245]
[245 245 245]
[245 245 245]]

..., 
[[245 245 245]
[245 245 245]
[245 245 245]
..., 
[245 245 245]
[245 245 245]
[245 245 245]]

[[245 245 245]
[245 245 245]
[245 245 245]
..., 
[245 245 245]
[245 245 245]
[245 245 245]]

[[245 245 245]
[245 245 245]
[245 245 245]
..., 
[245 245 245]
[245 245 245]
[245 245 245]]]
Run Code Online (Sandbox Code Playgroud)

如何获取张量流以打印出整个张量,而不是用省略号将其截断?

Fel*_*ema 2

使用numpy.savetxt

x = y = z = np.arange(0.0,5.0,1.0)
np.savetxt('test.out', x, delimiter=',')   # X is an array
np.savetxt('test.out', (x,y,z))   # x,y,z equal sized 1D arrays
np.savetxt('test.out', x, fmt='%1.4e')   # use exponential notation
Run Code Online (Sandbox Code Playgroud)