Skip to content

Optimize the 'Meter' class using experience#18

Merged
Ahzyuan merged 1 commit intov0.1.xfrom
chore/better-core
Mar 11, 2025
Merged

Optimize the 'Meter' class using experience#18
Ahzyuan merged 1 commit intov0.1.xfrom
chore/better-core

Conversation

@Ahzyuan
Copy link
Copy Markdown
Member

@Ahzyuan Ahzyuan commented Mar 11, 2025

📋 Summary

Optimize the Meter class experience, so its instance can truly replace the original model.

📝 Changes

Details
  • torchmeter/core.py:
    1. overwrite __getattr__, __setattr__ and __delattr__:the origin model's attribute and method can be accessed directly Meter class instance. Then the instance can 100% replace the origin model without any change in your code!
    2. add input type and value verification to ittp, rebase and profile.
    3. add __device_detect method to auto detect the device that pass in model on, simplify the procedure of creating instance.
    4. add tabel_cols method to quickly check the latest column names of the rendered table, so as to facilitate class name customization and adding custom columns.
    5. fix some bugs in structure property.

optimize the 'Meter' class experience so its instance can truly replace the original model.
@Ahzyuan Ahzyuan self-assigned this Mar 11, 2025
@Ahzyuan Ahzyuan merged commit c284b81 into v0.1.x Mar 11, 2025
@Ahzyuan Ahzyuan deleted the chore/better-core branch March 11, 2025 12:29
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.

1 participant