tensorflow / tfjs-wechat

WeChat Mini-program plugin for TensorFlow.js
https://tensorflow.org/js
539 stars 101 forks source link

无法使用 tensor.add等函数 #105

Closed Ruiyuan-Zhang closed 2 years ago

Ruiyuan-Zhang commented 2 years ago

在微信小程序中无法使用tensor.add() 或者是 .mul() 等一系列函数,只能使用tf.add()或者是tf.mul()等函数代替。 不知道 这个是为什么? let x = tf.tensor([1,2,3]) x.pow(tf.scalar(3)) // 会显示没有pow()函数而报错 tf.pow(x,tf.scalar(3))//这样就不会出错

pyu10055 commented 2 years ago

@zju-zry after Tensorflow 3.x, if you are only importing tfjs-core, the chain ops (i.e. tensor.add) for tensors has been removed. This allows to greatly reduce the bundle size. You can only use tf.add() method now.

Ruiyuan-Zhang commented 2 years ago

okay, thanks for your answer.