Skip to main content



reshape_like(v: Symbol, like: Symbol) -> Symbol

Reshapes a symbolic tensor to the same shape as another symbolic tensor.

The number and order of the elements in the tensor is unchanged. In other words, if you were to iterate over elements in the tensor by major dimension to minor dimension, the iteration order would stay the same.


  • v (Symbol): The input symbolic tensor to reshape.
  • like (Symbol): A symbolic tensor whose shape should be used as the reshape.


A symbolic tensor with the same elements as the original tensor, but in a new shape. The shape of the new tensor is the same as the shape of the like tensor.