Commit 1cf16447 authored by Jayaram Bobba's avatar Jayaram Bobba Committed by Robert Kimball

Avoid negative values in int64 initialization for cases where int64 parameters…

Avoid negative values in int64 initialization for cases where int64 parameters are used as indices (#3004)
parent e49dd589
...@@ -117,7 +117,7 @@ static void random_init(shared_ptr<runtime::Tensor> tv) ...@@ -117,7 +117,7 @@ static void random_init(shared_ptr<runtime::Tensor> tv)
case element::Type_t::i8: init_int_tv<int8_t>(tv, -1, 1); break; case element::Type_t::i8: init_int_tv<int8_t>(tv, -1, 1); break;
case element::Type_t::i16: init_int_tv<int16_t>(tv, -1, 1); break; case element::Type_t::i16: init_int_tv<int16_t>(tv, -1, 1); break;
case element::Type_t::i32: init_int_tv<int32_t>(tv, 0, 1); break; case element::Type_t::i32: init_int_tv<int32_t>(tv, 0, 1); break;
case element::Type_t::i64: init_int_tv<int64_t>(tv, -1, 1); break; case element::Type_t::i64: init_int_tv<int64_t>(tv, 0, 1); break;
case element::Type_t::u8: init_int_tv<uint8_t>(tv, 0, 1); break; case element::Type_t::u8: init_int_tv<uint8_t>(tv, 0, 1); break;
case element::Type_t::u16: init_int_tv<uint16_t>(tv, 0, 1); break; case element::Type_t::u16: init_int_tv<uint16_t>(tv, 0, 1); break;
case element::Type_t::u32: init_int_tv<uint32_t>(tv, 0, 1); break; case element::Type_t::u32: init_int_tv<uint32_t>(tv, 0, 1); break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment