Comments (3)
cc @jbschlosser
from pytorch.
From what I can tell, the __file__
attribute is only intended to be present on module objects and not type objects. For a type object, I think inspect.getfile(test_class_type)
(which is used for the repro command) will check the __file__
attribute of the module referenced by the type's __module__
attribute.
For this particular example, the __module__
attribute is inherited from the parent class by the metaprogrammed class via dct
:
pytorch/test/inductor/test_compiled_autograd.py
Lines 1519 to 1523 in a988b4e
This results in the wrong path being reported by the repro command.
>>> sys.modules[TestAutogradWithCompiledAutograd.__module__].__file__
'/home/jbschlosser/pytorch/test/test_autograd.py'
>>> inspect.getfile(TestAutogradWithCompiledAutograd)
'/home/jbschlosser/pytorch/test/test_autograd.py'
I'd suggest ensuring __module__
is correct for the metaprogrammed class, but idk if this is possible since the file it's defined in may not be related to a loaded module.
from pytorch.
Huh, I guess it checks __file__
anyway. Fixing __module__
should work. Using the original cls module seems like the ticket.
from pytorch.
Related Issues (20)
- dynamo test (test_model_output.py) failing on cpu devices because of cuda hardcoding for the device HOT 1
- torch C10 half type not compatible with nvidia __half atomicAdd HOT 2
- RFC: Integrate Arm Compute Library (ACL) into PyTorch as a submodule and add build support in setup.py HOT 4
- DISABLED test_parity__foreach_abs_fastpath_inplace_cuda_complex128 (__main__.TestForeachCUDA) HOT 1
- DISABLED test_binary_op_list_slow_path__foreach_div_cuda_uint8 (__main__.TestForeachCUDA) HOT 1
- Method for loading a distributed checkpoint into a single state_dict is being deprecrated without alternative, request to make it possible to keep that feature HOT 4
- _will_engine_execute_node expects an grad_fn, but got CppFunction HOT 1
- [BE][DTensor] get rid of @with_comms decorator for tests, and use run_test to init pg HOT 2
- Some MPS functionality regressed in MacOS-14.4 HOT 2
- torch.compile crash - Aborted exit code 134 HOT 2
- User-defined triton kernels fail with import error HOT 4
- Is it possible to serialize a torch.cuda.CUDAGraph into disk or CPU memory HOT 1
- failed assertion `[MPSNDArrayDescriptor sliceDimension:withSubrange:] error: subRange.start (6) is not less than length of dimension[0] (6)' HOT 4
- When using torch.onnx.export, the result of torch.scatter_add may be wrong for opset11 HOT 1
- dynamo recompiles identical layers when they have (identical) hooks
- Support for PyTorch on iOS Following PEP 730 HOT 5
- libtorch mimalloc Debug Warning with WinError
- Lint collect_env with Python-3.5 started to fail HOT 1
- TypeError: dot() missing 1 required positional arguments: "tensor" HOT 5
- `WeightedRandomSampler` convert weights `dtype=torch.double` internally but `MPS` only support `dtype=torch.float32` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch.