Lightning-AI/lightning-thunder

Make `numel` a method of TensorProxy not a property attribute

Open

#925 opened on Aug 5, 2024

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Python (114 forks)github user discovery
good first issue

Repository metrics

Stars
 (1,460 stars)
PR merge metrics
 (PR metrics pending)

Description

🐛 Bug

PyTorch uses tensor.numel() while Thunder's TensorProxy and in the codebase it's used as a property tensor.numel. The property attribute makes more sense, but it conflicts with setting PyTorch as the default language context (https://github.com/Lightning-AI/lightning-thunder/pull/924).

Related PR: https://github.com/Lightning-AI/lightning-thunder/pull/278

We should decide what to do with numel and how to avoid the discrepancy with PyTorch.

Contributor guide