Skip to content

Commit

Permalink
respond to review comments. Thanks @siju-samuel
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Brookhart committed Jul 7, 2020
1 parent 3f366e5 commit ddacae5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/tvm/relay/op/dyn/_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ def tile_shape_func(attrs, inputs, _):
"""
ndim = len(inputs[0].shape)
rdim = inputs[1].shape[0].value
assert ndim == rdim, "tile data and res ranks don't match"
assert ndim == rdim, "tile data and reps ranks don't match"
return [_tile_shape_func(inputs[0], inputs[1], convert(ndim))]
3 changes: 0 additions & 3 deletions tests/python/relay/dyn/test_dynamic_op_level3.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ def verify_tile(dshape, reps):
func = relay.Function([x, r], z)
x_data = np.random.uniform(low=-1, high=1, size=dshape).astype("float32")
ref_res = np.tile(x_data, reps=reps)
print (ref_res.shape)
print(x_data.shape)
print(np.array(reps).shape)
verify_func(func, [x_data, np.array(reps).astype("float32")], ref_res)
verify_tile((2, 3, 4), (3, 2, 1))
verify_tile((2, 3, 4), (1, 2, 1))
Expand Down
4 changes: 1 addition & 3 deletions topi/include/topi/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ inline Tensor tile(const Tensor& x, Array<Integer> reps, std::string name = "T_t
* \brief Creates an operation to tile elements of an array
*
* \param x The input tensor
* \param reps The number of times for repeating the tensor
* \param new_shape The shape of the output after tiling
* \param name The name of the operation
* \param tag The tag to mark the operation
*
Expand All @@ -1029,8 +1029,6 @@ inline Tensor tile(const Tensor& x, Array<Integer> reps, std::string name = "T_t
inline Tensor dyn_tile(const Tensor& x, Array<PrimExpr> new_shape, std::string name = "T_tile",
std::string tag = kBroadcast) {
size_t ndim = x->shape.size();
std::cout << ndim << std::endl;
std::cout << new_shape << std::endl;
if (is_empty_shape(new_shape)) {
return compute(
new_shape, [&](const Array<Var>& indices) { return tvm::cast(x->dtype, 0); }, name, tag);
Expand Down

0 comments on commit ddacae5

Please sign in to comment.