mindspore.set_deterministic
- mindspore.set_deterministic(deterministic)[source]
Enables or disables deterministic computing.
When deterministic computing is enabled, the same output is generated if an operator is executed for multiple times with the same hardware and input.This often slows down operator execution. In distributed scenario, we suggest user to set deterministic mode before calling
mindspore.communication.init()
to enable deterministic operation for communication operators in the global communication group.The framework not enabled deterministic computation by default.
- Parameters
deterministic (bool) – Whether to enable deterministic computing.
Examples
>>> import mindspore as ms >>> ms.set_deterministic(True)