Rename variables from single letter to better naming
See original GitHub issuePretty much all code in https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py still corresponds to the copy-pasted version from the beginning.
While weight names shouldn’t be renamed, we should rename all single letter variables to more explicit variable naming. E.g. h
-> hidden_states
.
Single letter variables are hard to deal with as search and replace doesn’t work on them and are hard to read
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:19 (19 by maintainers)
Top Results From Across the Web
Should I refactor single letter variables for constructs like ...
That said, refactoring is a good way to rename variables to something more telling. Most modern IDE's can do this for you. Be...
Read more >4. How to label variable names, variable values and rename ...
STATA PLAYLIST: https://www.youtube.com/playlist?list=PLEJsR-Ek_ZPJEb-nXq1_s7m_hes75uD4DHow to label variable names, variable values and ...
Read more >3.8 Rename variables | An Introduction to R for Research
You can rename a variable in a dataset by changing a value in the names() vector (base R) or by using the rename()...
Read more >How to Better Name Your Functions and Variables | The Startup
How to Better Name Your Functions and Variables · TLDR; · Choose a word with meaning · Avoid generic names · Attach additional...
Read more >Data Scientists, Your Variable Names Are a Mess. Clean Up ...
Learn how to improve your code quality with clearer variable names. ... writing research-oriented data science code for one-off analyses to ...
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
@daspartho ,q, k, v can be replaced with query,key,value. b, c, h, w can be replaced with batch,channel,height,weight .
Hey @i-am-epic @daspartho , there are still some places with single letter variables in
resenet.py
, feel free to work on those! I’m listing them down here.https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py#L37 https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py#L54 https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py#L177 https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py#L239 https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/resnet.py#L329