Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensor setup via method chaining #182

Open
dboyliao opened this issue Oct 1, 2019 · 7 comments
Open

Tensor setup via method chaining #182

dboyliao opened this issue Oct 1, 2019 · 7 comments
Labels
idea All ideas are welcomed

Comments

@dboyliao
Copy link
Member

dboyliao commented Oct 1, 2019

Sth like this:

Tensor* t = new Tensor();
(t->setShape({3, 3})->setAddress(<address>)->....) // setup whatever you need.

It'll be a lot easier to design a template for the code generator if we have many mechanism to control how tensor behave at the runtime.
Mostly mem allocation for now, but I can see there'll be more to come in the future.

@dboyliao dboyliao added the idea All ideas are welcomed label Oct 1, 2019
@mbartling
Copy link
Member

I like the idea of chaining, but what do you mean by setAddress?

@dboyliao
Copy link
Member Author

dboyliao commented Oct 4, 2019

Oh, It's about @Knight-X's mem allocation optimization pass.
That is, allocate the tensor at specific address (in mem pool managed by uTensor runtime).

@neil-tan
Copy link
Member

neil-tan commented Oct 4, 2019

aka. offline memory planning

@dboyliao
Copy link
Member Author

dboyliao commented Oct 4, 2019

The naming is just for illustrating the idea.
Maybe we can use another more informative name.

@mbartling
Copy link
Member

Force addressing here is kinda scary, especially if you rope in linker scripts like most people do in production environments

@dboyliao
Copy link
Member Author

Oh, linker scripts.
Well, maybe we need a better naming.
I just want to setup a script how the api would look like though.
Method chaining will make the api and the template much more readable and maintainable.

@mbartling
Copy link
Member

Method chaining can also be done super efficiently :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea All ideas are welcomed
Projects
None yet
Development

No branches or pull requests

3 participants