Attend the Women in ML Symposium on December 7 Register now


Stay organized with collections Save and categorize content based on your preferences.

Replicates a tensor so as to match the given outer shape.


  • t = [1, 2, 3], [4, 5, 6]
  • outer_shape = [2, 1] The shape of the resulting tensor is: [2, 1, 2, 3] and its content is: [[t], [t]]

tensor A tf.Tensor.
outer_shape Outer shape given as a 1D tensor of type list, numpy or tf.Tensor.

The replicated tensor.

ValueError when the outer shape is incorrect.