From d6a4765c9cf4a7b08980381b67245cb51256be2f Mon Sep 17 00:00:00 2001 From: Georgy Krivoruchko Date: Fri, 21 Jun 2024 13:20:59 +0400 Subject: [PATCH] Update random_normal_helper.cpp --- src/frontends/common/src/random_normal_helper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontends/common/src/random_normal_helper.cpp b/src/frontends/common/src/random_normal_helper.cpp index 99a6cda8451e41..8370c3cc16d1ba 100644 --- a/src/frontends/common/src/random_normal_helper.cpp +++ b/src/frontends/common/src/random_normal_helper.cpp @@ -31,7 +31,8 @@ OutputVector make_random_normal(pass::NodeRegistry& registry, // just interpret its value as a 32-bit value (float zero value is same with // uint32 zero value). // Float -0 value will be interpreted as a valid uint32 value. - const void* seed_ptr = &seed; // To prevent strict-aliasing error + const float seed_float = seed; // To prevent unexpected runtime errors due to storing seed in a register + const void* seed_ptr = &seed_float; // To prevent strict-aliasing error const uint64_t op_seed = static_cast(*static_cast(seed_ptr)); // We need to use two op_seeds to make sure we get different results for two RandomUniform series