- Gradient tensor values are inconsistently set to NaN
- NaN values caused incorrect backwarding in Neural Net
- Replacing malloc with calloc prevents memory allocation with value set to NaN
Signed-off-by: Donghyeon Jeong <djeong20@illinois.edu>
if (mem_pool != nullptr)
throw std::runtime_error("Memory pool is already allocated");
- mem_pool = malloc(pool_size);
+ mem_pool = calloc(pool_size, 1);
if (mem_pool == nullptr)
throw std::runtime_error(
"Failed to allocate memory: " + std::to_string(pool_size) + "bytes");