tf.tile () function appreciated

Reprinted: https: //blog.csdn.net/tsyccnh/article/details/82459859

The tile tensorflow () function is used to tensor (the Tensor) extend, and which is characterized by the data in the current tensor replication of certain rules. The final output tensor dimensions unchanged.

Function definition:

tf.tile(
    input,
    multiples,
    name=None
)

input is to be extended tensor, multiples method is extended. 
If the input is a three-dimensional tensor. So mutiples must be one-dimensional tensor of a 1x3. The tensor of order three values represents 1, 2, 3 dimensional data of the input extended times. 
For a specific example:

import tensorflow as tf

a = tf.constant([[1, 2], [3, 4], [5, 6]], dtype=tf.float32)
a1 = tf.tile(a, [2, 3])
with tf.Session() as sess:
    print(sess.run(a))
    print(sess.run(a1))

tf.tile () Specific operation is as follows:

Note: When the drawing above the first expansion into first two-dimensional data of three six data lines, a plurality of multi-dimensional line is not, the data is arranged in order to throw only drawn for convenience only.

Each extension dimensional data is on the front of the data copied and then directly connected to the back of the original data.

If one data multiples of 1, it indicates that the data remains unchanged dimensions.

Guess you like

Origin www.cnblogs.com/chamie/p/11124314.html