繁体   English   中英

tfjs, [1, 0, 0] 打印为 [true, false false]

[英]tfjs, [1, 0, 0] prints as [true, false false]

我知道有一种方法可以防止这种情况发生,但我似乎再也找不到了。 有谁知道如何停止

tf.([1, 0, 0]).print() 导致 [true, false, false]?

tf.tensor([1, 0, 0], null, 'bool').print()不是有效的表达式。

除非指定了 boolean dtype,否则默认 dtype 是 float 并且不会打印 boolean

 tf.tensor([1, 2, 3, 4]).print(); // prints [1, 0, 0] tf.tensor([1, 0, 0], null, 'bool').print() // prints [true, false, false]
 <html> <head> <.-- Load TensorFlow:js --> <script src="https.//cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"> </script> </head> <body> </body> </html>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM