Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/tvm/relax/frontend/nn/_tensor_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def minimum(self, other):
other = _convert_scalar(other, self)
return _op().minimum(self, other)

def reshape(self, shape):
def reshape(self, *shape):
return _op().reshape(self, shape)

def permute_dims(self, axes):
def permute_dims(self, *axes):
return _op().permute_dims(self, axes)

def repeat(self, repeats: int, axis: Optional[int] = None):
Expand Down
10 changes: 5 additions & 5 deletions tests/python/relax/test_frontend_nn_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import numpy as np
import pytest

import tvm
import tvm.testing
from tvm import relax
from tvm.relax.frontend.nn import Tensor, Module, spec
from tvm.relax.frontend.nn import Module, Tensor, spec
from tvm.script import relax as R

import numpy as np


def test_tensor_from_numpy():
x = np.random.rand(1, 10)
Expand Down Expand Up @@ -136,8 +136,8 @@ def test(x: R.Tensor((1, 10), dtype="float32"), _io: R.Object) -> R.Tuple(R.Tens
def test_tensor_op_manipulate():
class Model(Module):
def test(self, x: Tensor):
z0 = x.reshape([2, 5, 2])
z1 = x.permute_dims([2, 1, 0])
z0 = x.reshape(2, 5, 2)
z1 = x.permute_dims(2, 1, 0)
z2 = x.repeat(2, axis=1)
return (z0, z1, z2)

Expand Down