sponge.function.periodic_difference
- sponge.function.periodic_difference(difference: Tensor, period: Tensor, mask: Tensor = None, offset: float = - 0.5)[source]
get value of difference between periodic variables.
- Parameters
variable (Tensor) – Tensor of shape (…). Data type is float. Periodic variable
period (Tensor) – Tensor of shape (…). Data type is float. Upper boundary of perodicity.
mask (Tensor) – Tensor of shape (…). Data type is bool_. Mask for the periodic variable.
offset (float) – Offset ratio \(c\) with relative to the period \(\theta\). Default: -0.5
- Returns
period_diff (Tensor), Tensor of shape (…). Data type is float. Variable with value in the periodic range.
- Supported Platforms:
Ascend
GPU