title: Explicit vs implicit type definition in TensorFlow
body: <p>I'm just beginning to learn TensorFlow. Quoting from the <a href="https://www.tensorflow.org/guide/low_level_intro#graph" rel="nofollow noreferrer">documentation</a>:</p>
  
  <blockquote>
    <p>Let's build a simple computational graph. The most basic operation is a constant. The Python function that builds the operation takes a tensor value as input. The resulting operation takes no inputs. When run, it outputs the value that was passed to the constructor. We can create two floating point constants a and b as follows:</p>
  </blockquote>
  
  <pre><code>a = tf.constant(3.0, dtype=tf.float32)
  b = tf.constant(4.0) # also tf.float32 implicitly
  total = a + b
  print(a)
  print(b)
  print(total)
  </code></pre>
  
  <p>The second constant is implicitly typed as a float32. Is that based on the explicit typing of the first constant? And does that imply that the first <code>dtype</code> is required? <a href="https://www.tensorflow.org/api_docs/python/tf/constant" rel="nofollow noreferrer">tf.constant documentation</a> would imply that it does not:</p>
  
  <blockquote>
    <p>If the argument dtype is not specified, then the type is inferred from the type of <code>value</code>.</p>
  </blockquote>
  
  <p>But then it would be unnecessary to explicitly type the 3.0 constant above.</p>
  
  <p>I'm just looking for some clarification on this, since, like I said, I'm just starting out.</p>