tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] notoraptor commented on pull request #5716: [topi][relay] Add operation gather to relay.
Date Thu, 04 Jun 2020 18:34:13 GMT

notoraptor commented on pull request #5716:
URL: https://github.com/apache/incubator-tvm/pull/5716#issuecomment-639035230


   @mbrookhart Hi ! There is a difference at least in the output shape for take: https://github.com/mbrookhart/incubator-tvm/blob/062a244d66262353cdef0792a54d05cc99d7fa74/topi/include/topi/transform.h#L762
.
   
   With `take`, in output shape, the axis seems to be replaced with indices size. So, for
example, if data has shape `(1, 2, 3)`, and axis is `1`, and indices has shape `(4, 5)`, then
output shape will be `(1, 4, 5, 3)`.
   
   With the `gather` operation here, number of dimensions does not change as output shape
only replaces axis with corresponding axis shape in indices (so that output has same shape
as indices). For example, if data has shape `(1, 2, 3)`, and axis is `1`, and indices has
shape `(1, 7, 3)` (indices must have same ndim as input), then output shape will be `(1, 7,
3)`.
   
   I may look for other existing operations which would allow to get same result as this `gather`,
but it seems I can not achieve it with `take`. Each take-like operation seems to come with
its own deails.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message