fork download
  1. import tensorflow as tf
  2. a=tf.constant(5)
  3. b=tf.constant([1.0,2.0,3.0])
  4. c=tf.constant([[1,2],[3,4]])
  5. print(type(c),c.shape)
  6. W = tf.Variable(initial_value=tf.random.normal([2, 2]), name='weights')
  7. print(W)
Success #stdin #stdout #stderr 1.1s 198564KB
stdin
Standard input is empty
stdout
(<class 'tensorflow.python.framework.ops.Tensor'>, TensorShape([Dimension(2), Dimension(2)]))
<tf.Variable 'weights:0' shape=(2, 2) dtype=float32_ref>
stderr
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.