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

How to convert goslice to libtorch.cTensor fast? #28

Open
ZonghaoWang opened this issue Apr 23, 2021 · 6 comments
Open

How to convert goslice to libtorch.cTensor fast? #28

ZonghaoWang opened this issue Apr 23, 2021 · 6 comments

Comments

@ZonghaoWang
Copy link

my performance block by the ts.NewTensorFrom, it costs too much time

@sugarme
Copy link
Owner

sugarme commented Apr 23, 2021

@ZonghaoWang

Can you give more detail - code example and how you measure your performance please?

@ZonghaoWang
Copy link
Author

image

DeepX is an float32 slice, whose length is 2000000. I convert it to ctensor and reshape to 1000 X 2000.
The time costs is 130ms

@sugarme
Copy link
Owner

sugarme commented Apr 23, 2021

Your time measurement was taken for other steps after ts.TensorFrom.
Can you just break down just calculate time for ‘ts.TensorFrom’ only? And how do you judge it is slow? In comparison to which?
Thanks.

@ZonghaoWang
Copy link
Author

ZonghaoWang commented Apr 23, 2021

hi,
image
image

@sugarme
Copy link
Owner

sugarme commented Apr 23, 2021

Any how slow to compare to Python Pytorch? Or other framework?

@ZonghaoWang
Copy link
Author

ZonghaoWang commented Apr 23, 2021

Year, I just like go, and use it to train and serving model.
When I train small model, the input data convert between go and c may cost too much time. And I test some method to acc it.
like this:
image
image

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

No branches or pull requests

2 participants