昇腾社区首页
中文
注册

def step

函数功能

更新噪声。

函数原型

def step(self, pred: Tensor.FloatTensor, timesteps: List[float], i: int, noise: Tensor.FloatTensor, guidance_scale: float = 7.0):

参数说明

参数名

输入/输出

说明

pred

输入

预测噪声,必须为5维输入。

timesteps

输入

包含所有时间步的列表,输入List长度必需等于配置的num_sampling_steps。

i

输入

当前时间步索引,支持输入的范围为:[0, num_sampling_steps)

noise

输入

当前噪声,必须为5维输入。

guidance_scale

输入

用于调整条件预测和无条件预测之间的权重,影响生成结果的多样性。

可选输入,默认值为7.0。

返回值说明

更新后的噪声。