TensorFlow 基础

大佬你好, 我想请问一下我遇到的这个问题怎么解决:

InvalidArgumentError                      Traceback (most recent call last)
<ipython-input-24-dfbd31710005> in <module>
     11 for e in range (num_epoch):
     12     with tf.GradientTape () as tape:
---> 13         y_pred = a * X + b
     14         loss = tf.reduce_sum (tf.square (y - y_pred))
     15     grads = tape.gradient (loss, variables)

InvalidArgumentError: cannot compute Mul as input #1 (zero-based) was expected to be a float tensor but is a double tensor [Op:Mul] name: mul/

看上去像是数据类型的问题, 应该怎么解决呢?