sponge.function.periodic_variable

View Source On Gitee
sponge.function.periodic_variable(variable: Tensor, upper: Tensor, lower: Tensor = 0, mask: Tensor = None)[source]

get the value in the periodic range.

Parameters
  • variable (Tensor) – Tensor of shape (…). Data type is float. Periodic variable

  • upper (Tensor) – Tensor of shape (…). Data type is float. Upper boundary of perodicity.

  • lower (Tensor) – Tensor of shape (…). Data type is float. Lower boundary of perodicity. Default: 0

  • mask (Tensor) – Tensor of shape (…). Data type is bool_. Mask for the periodic variable.

Returns

period_value (Tensor), Tensor of shape (…). Data type is float. Variable with value in the periodic range.

Supported Platforms:

Ascend GPU