You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from multiprocessing import get_context
class Bar:
def __init__(self):
self.total = 0
...
def __add__(self, other):
counter = Bar()
for attr, val in counter.__dict__.items():
if isinstance(val, int):
counter[attr] += self[attr] + other[attr]
return counter
def __getitem__(self, item):
return self.__getattribute__(item)
def __setitem__(self, key, value):
self.__setattr__(key, value)
def foo(frag):
counter = Bar()
counter.total += frag
return counter
if __name__ == '__main__':
frags = [*range(8)]
with get_context('spawn').Pool(8) as pool:
_ = sum(pool.imap_unordered(foo, frags), start=Bar())
after ran viztracer test.py
got this error
The text was updated successfully, but these errors were encountered:
Honesty-of-the-Cavernous-Tissue
changed the title
AttributeError: Can't get attribute 'Bar' on <module '__main__' from '/Users/zyq/miniconda3/envs/3.12.0/bin/viztracer'>
AttributeError: Can't get attribute on <module '__main__' from '/Users/zyq/miniconda3/envs/3.12.0/bin/viztracer'>
Apr 6, 2024
Honesty-of-the-Cavernous-Tissue
changed the title
AttributeError: Can't get attribute on <module '__main__' from '/Users/zyq/miniconda3/envs/3.12.0/bin/viztracer'>
AttributeError: Can't get attribute on <module '__main__' from 'miniconda3/envs/3.12.0/bin/viztracer'>
Apr 6, 2024
Honesty-of-the-Cavernous-Tissue
changed the title
AttributeError: Can't get attribute on <module '__main__' from 'miniconda3/envs/3.12.0/bin/viztracer'>
AttributeError: Can't get attribute on <module '__main__' from 'miniconda3/envs/3.12.0/bin/viztracer'>
Apr 6, 2024
Honesty-of-the-Cavernous-Tissue
changed the title
AttributeError: Can't get attribute on <module '__main__' from 'miniconda3/envs/3.12.0/bin/viztracer'>
AttributeError: Can't get attribute 'Bar' on <module '__main__' from 'miniconda3/envs/3.12.0/bin/viztracer'>
Apr 6, 2024
python:
3.12.0
viztracer:
0.16.2
os:
macOS
here's my test script
after ran
![image](https://private-user-images.githubusercontent.com/42966697/320190779-0113dcf4-8f0a-4984-b62a-9da64f373827.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4OTYxMzksIm5iZiI6MTcxODg5NTgzOSwicGF0aCI6Ii80Mjk2NjY5Ny8zMjAxOTA3NzktMDExM2RjZjQtOGYwYS00OTg0LWI2MmEtOWRhNjRmMzczODI3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIwVDE1MDM1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRiZTBjNmYwYTJlMWI3OTZjNWQ1NjUzZWE5YmU3ZTkzNzFiMmVlYzJjNmJiNjhjZDU3ZDk2Mjc1ZDE1NjM5YTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.N4GeWOVFOcy624QxgV8uFXbkZKALVazN6CUEb6Jj9As)
viztracer test.py
got this error
The text was updated successfully, but these errors were encountered: