Search code examples
pythontensorflowmachine-learningtheano

equivalence of Theano.tensor.ivector of Theano in Tensorflow


I am new in Tensorflow and Theano.

What is the equivalence Theano.tensor.ivector in Tensorflow?

For instance,

x = Theano.tensor.ivector('x')
y = Theano.tensor.ivector('y')

Solution

  • As far as I understand, something like this would be equivalent:

    import tensorflow as tf
    
    x = tf.Variable([1, -2, 3], tf.int32, name='x')
    

    you can find some additional information about theano and tensorflow variables in the following links (thanks bouteillebleu):

    http://deeplearning.net/software/theano/library/tensor/basic.html https://www.tensorflow.org/programmers_guide/dims_types


    If you are using these as inputs and you don't know the initial contents, you have to use placeholders:

    import tensorflow as tf
    
    x = tf.placeholder(tf.int32, name='x')