Commit ebcad896 by Haichen Shen Committed by eqy

Fix typo (#2595)

thanks @icemelon9, this is merged
parent 7e6cba48
...@@ -44,7 +44,7 @@ inline Expr RavelIndex(Array<Var> indices, Array<Expr> shape) { ...@@ -44,7 +44,7 @@ inline Expr RavelIndex(Array<Var> indices, Array<Expr> shape) {
* *
* \return The coordinate corresponding to the 1D index * \return The coordinate corresponding to the 1D index
*/ */
inline Array<Expr> UnavelIndex(Expr idx, Array<Expr> shape) { inline Array<Expr> UnravelIndex(Expr idx, Array<Expr> shape) {
std::vector<Expr> indices; std::vector<Expr> indices;
for (int i = static_cast<int>(shape.size()) - 1; i >= 0; --i) { for (int i = static_cast<int>(shape.size()) - 1; i >= 0; --i) {
......
...@@ -188,7 +188,7 @@ inline Tensor reshape(const Tensor& x, ...@@ -188,7 +188,7 @@ inline Tensor reshape(const Tensor& x,
auto x_shape = x->shape; auto x_shape = x->shape;
return compute( return compute(
newshape, [&](const Array<Var>& indices) { newshape, [&](const Array<Var>& indices) {
return x(UnavelIndex(RavelIndex(indices, newshape), x_shape)); return x(UnravelIndex(RavelIndex(indices, newshape), x_shape));
}, name, tag); }, name, tag);
} }
...@@ -566,7 +566,7 @@ inline Tensor take(const Tensor& a, ...@@ -566,7 +566,7 @@ inline Tensor take(const Tensor& a,
for (size_t j = 0; j < indices->shape.size(); ++j) { for (size_t j = 0; j < indices->shape.size(); ++j) {
indices_position.push_back(out_index[j]); indices_position.push_back(out_index[j]);
} }
return a(UnavelIndex(indices(indices_position), a_shape)); return a(UnravelIndex(indices(indices_position), a_shape));
}, name, tag); }, name, tag);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment