Need hash_func for type torch._C._TensorBase
See original GitHub issueSummary
A community member noticed a “cannot hash of type” issue. More information can be found in this forum discussion.
Full error message
This is the info provided by hertzmann:
“UnhashableType: Cannot hash object of type torch._C._TensorBase”.
"I’m trying to cache initialization of a StyleGAN2 class datastructure (which includes loading model weights from a file or online). I don’t want the model weights to be reloaded (and other data structures re-initialized) every time a new image is created.
I tried refactoring my code so that @st.cache is in front of a function that only does one thing: torch.load(filename) and the same error occurs."
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Pytorch class torch._C.TensorBase information?
I am wondering from where the tensor._c.TensorBase comes from?Can Someone please tell me the c source ...
Read more >Class Tensor — PyTorch master documentation
This function returns the forward gradient for this Tensor at the given level. void _set_fw_grad (const TensorBase &new_grad, uint64_t level, bool is_inplace_op) ...
Read more >Torch Core - fastai
Show all images ims as subplots with rows using titles . Type, Default, Details. ims. nrows, int, 1 ...
Read more >Simple index - piwheels
... fdi flask-bootstraps apachecn-c-cpp-zh-pt2 pdb2af django-geoposition javaoneliner pipe21 taichi types-aiobotocore-mediaconvert tradinghalts-02 nzbsort ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s a code snippet that gives the originally-reported error:
which gives:
Note that this variant fails even with allow_output_mutation=True
Hey @hertzmann,
Thanks for providing the above 🙏. Going to circle back with the team with the new info and then will get back to you, but might not be able to respond before next week. If not, hope you have a nice weekend and will reach back out soon.