Tensors can take up any one of the datatypes Datatype Python type Description
DT_INT8 tf.int8 signed integer of 8 bits DT_INT16 tf.int16 signed integer of 16 bits DT_INT32 tf.int32 signed integer of 32 bits DT_INT64 tf.int64 signed integer of 64 bits DT_UINT8 tf.uint8 unsigned integer of 8bits DT_UINT16 tf.uint16 unsigned integer of 16bits DT_FLOAT tf.float32 floating point number of size 32bits DT_DOUBLE tf.float64 floating point number of size 64biys DT_STRING tf.string byte arrays of variable lengths. Each element of a Tensor is a byte array DT_BOOL tf.bool Boolean value true or false DT_COMPLEX64 tf.complex64 Complex number made of two 32 bits floating points: real and imaginary parts DT_COMPLEX128 tf.complex128 Complex number made of two 64 bits floating points: real and imaginary parts DT_QINT8 tf.qint8 Signed integer of 8bits used in quantized Ops. DT_QINT32 tf.qint32 Signed integer of 32bits used in quantized Ops. DT_QUINT8 tf.quint8 unsigned integer of 8bits used in quantized Ops.TensorFlow gives various operations to perform basic arithmetic operators to your graph. Operator Description
tf.add(x,y,name=None) Returns tensor with x + y element-wise. tf.subtract(x,y,name=none) Returns tensor with x - y element-wise. tf.multiply(x,y,name=none) Returns tensor x * y element-wise. tf.scalar_mul(scalar,x) Multiplies scalar with tensor (scalor*x) and returns multiplied tensor. tf.div(x,y,name=none) Divides x / y elementwise and returns tensor tf.divide(x,y,name=none) Computes Python style division of x by y tf.truediv(x,y,name=none) This function converts integer into floating point and then divides. This operator is generated by normal x / y division in Python 3 tf.floordiv(x,y,name=none) Divides x / y elementwise, rounding toward the most negative integer. tf.realdiv(x,y,name=none) Returns x / y element-wise for real types.If x and y are reals, this will return the floating-point division. tf.truncatemod(x,y,name=none) Returns element-wise remainder of division. tf.cross(x,y,name=none) Compute the pairwise cross product.x and y must be the same shape; they can either be simple 3-element vectors, or any shape where the innermost dimension is 3. In the latter case, each pair of corresponding 3-element vectors is cross-multiplied independently.转自:http://developercoding.com/tensorflow/datatype-operators.php
