导入当前文件夹(建了_init_.py)下的包:
1
from . import diffusion, unet
数字前自动补0:
1
name=f'{number:05d}.png'
argparse
库在处理命令行参数时,自动将命令行中的-
(连字符)转换为变量名中的_
(下划线)使用进度条:
1
iterator = tqdm(time_range, desc='DDIM Sampler', total=total_steps)
省略
1
b, *_, device = *x.shape, x.device