FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add Operators: subtraction, multiplication, concat and stride slice by dboyliao · Pull Request #224 · uTensor/uTensor · GitHub

Add Operators: subtraction, multiplication, concat and stride slice - #224

Open
dboyliao wants to merge 28 commits into
developfrom
dboy_work
Open

Add Operators: subtraction, multiplication, concat and stride slice#224
dboyliao wants to merge 28 commits into
developfrom
dboy_work

Conversation

dboyliao commented Jun 6, 2021

Copy link
Copy Markdown
Member

Add operators to runtime:

  • SubOperator: elementwise subtraction
  • MulOperator: elementwise multiplication
  • ConcatOperator: concat tensors along given axis
  • StrideSliceOperator: strided tensor slicing, ex t[:, ..., :3]

dboyliao requested review from mbartling and neil-tan June 6, 2021 04:45

Copy link
Copy Markdown
Member

@dboyliao Can you add some quick comments on the StridedIterator in this chat? I'm pretty sure you wrote the original stride op

dboyliao commented Jun 7, 2021
edited
Loading

Copy link
Copy Markdown
Member Author

Ok.
The basic idea of StridedIterator is simple, it will give you the linear index/offset of the source tensor given the stride slice specs.
For example, if the given slice specs are 0:3 and 1:5:2 and input tensor of shape (5, 10), all possible strided indices are:

  • (0, 1), with linear index 1
  • (0, 3), with linear index 3
    ....
  • (2, 9), with linear index 29

Then in the strided slice op, I only need to copy value from source tensor based on the linear indices.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL