title: what is the difference between `tf.multiply` and `*`?
body: <p>After <code>import tensorflow.kera.backend as K</code>  </p>
  
  <p><strong>what is the difference between <code>tf.multiply</code> and <code>*</code>?</strong> </p>
  
  <p><strong>Similarly, What is the difference between <code>K.pow(x, -1)</code> and <code>1/x</code>??</strong></p>
  
  <p>I write the following codes of a customized metrics function based on some other's codes.</p>
  
  <pre><code>def dice_coef_weight_sub(y_true, y_pred):
      """
      Returns the product of dice coefficient for each class
      """
      y_true_f = (Lambda(lambda y_true: y_true[:, :, :, :, 0:])(y_true))
      y_pred_f = (Lambda(lambda y_pred: y_pred[:, :, :, :, 0:])(y_pred))
  
      product = tf.multiply([y_true_f, y_pred_f]) # multiply should be import from tf or tf.math
  
      red_y_true = K.sum(y_true_f, axis=[0, 1, 2, 3]) # shape [None, nb_class]
      red_y_pred = K.sum(y_pred_f, axis=[0, 1, 2, 3])
      red_product = K.sum(product, axis=[0, 1, 2, 3])
  
      smooth = 0.001
      dices = (2. * red_product + smooth) / (red_y_true + red_y_pred + smooth)
  
      ratio = red_y_true / (K.sum(red_y_true) + smooth)
      ratio = 1.0 - ratio
      # ratio =  K.pow(ratio + smooth, -1.0) # different method to get ratio
  
      return K.sum(multiply([dices, ratio]))
  </code></pre>
  
  <p>In the codes, can I replace <code>tf.multiply</code> by <code>*</code>? Can I replace <code>K.pow(x,-1)</code> by <code>1/x</code>??</p>
  
  <p>(From tensorflow's document, I know the difference between <code>tf.pow</code> and <code>K.pow</code>: <code>tf.pow(x,y)</code> receives 2 tensors to compute x^y for corresponding elements in <code>x</code> and <code>y</code>, while <code>K.pow(x,a)</code> receives a tensor <code>x</code> and a integer <code>a</code> to compute x^a. But I do not know why in the above code <code>K.pow</code> receives a float number 1.0 and it still works norally)</p>