Skip to content

Commit

Permalink
Update random_normal_helper.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
gkrivor authored Jun 21, 2024
1 parent 70337cc commit d6a4765
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/frontends/common/src/random_normal_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const uint64_t>(*static_cast<const uint32_t*>(seed_ptr));

// We need to use two op_seeds to make sure we get different results for two RandomUniform series
Expand Down

0 comments on commit d6a4765

Please sign in to comment.