簡體   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