简体   繁体   English

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

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

I know theres a method that prevents this but I can't seem to find it anymore.我知道有一种方法可以防止这种情况发生,但我似乎再也找不到了。 Does anyone know how to stop有谁知道如何停止

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

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

And unless a boolean dtype is specified, the default dtype is float and it will not print boolean除非指定了 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