๋ชฉ๋ก2025/01/07 (2)
๐บ๐๐๐๐๐
[Python] What is "self" in Python?
In Python, "self" refers to the specific instance that is calling the method. So, "self" is used to assign or update attributes for the specific instance.# Defining a Class using "self"class greatatcoding: def __init__(self, name, age): self.name = name # "self.name" is an instance attribute; "name" is a local parameter self.age = age def hello(self): print(f"..
Python
2025. 1. 7. 03:42
[Python] Debugging tool (Pdb)
Here are some useful code lines for debugging using Pdb..(Pdb) print(UNet2DConditionModel)(Pdb) import inspect(Pdb) print(inspect.getfile(UNet2DConditionModel))/home/aiv-du/anaconda3/envs/text2videozero/lib/python3.9/site-packages/diffusers/models/unet_2d_condition.py (Pdb) import torchvision.utils as tu(Pdb) tu.save_image(xT[0], 'xT[0].png')
Python
2025. 1. 7. 03:05