Commit 4d3e4721 authored by Jaikrishnan Menon's avatar Jaikrishnan Menon Committed by Jayaram Bobba

Fix broken tensor write/bug introduced by a cleanup (#1232)

parent 9bb0b653
...@@ -127,7 +127,7 @@ void init_int_tv(shared_ptr<runtime::TensorView> tv, T min, T max) ...@@ -127,7 +127,7 @@ void init_int_tv(shared_ptr<runtime::TensorView> tv, T min, T max)
{ {
element = dist(s_random_engine); element = dist(s_random_engine);
} }
tv->write(vec.data(), 0, vec.size()); tv->write(vec.data(), 0, vec.size() * sizeof(T));
} }
template <typename T> template <typename T>
...@@ -140,7 +140,7 @@ void init_real_tv(shared_ptr<runtime::TensorView> tv, T min, T max) ...@@ -140,7 +140,7 @@ void init_real_tv(shared_ptr<runtime::TensorView> tv, T min, T max)
{ {
element = dist(s_random_engine); element = dist(s_random_engine);
} }
tv->write(vec.data(), 0, vec.size()); tv->write(vec.data(), 0, vec.size() * sizeof(T));
} }
static void random_init(shared_ptr<runtime::TensorView> tv) static void random_init(shared_ptr<runtime::TensorView> tv)
......
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