INFO(lfbn) << "TFFBN const_num_elements = " << const_num_elements << std::endl;
// fbn_epsilon = %4:variance + fbn_epsilon_array
- std::unique_ptr<float> fbn_epsilon{new float[const_num_elements]};
+ std::unique_ptr<float[]> fbn_epsilon{new float[const_num_elements]};
for (int32_t i = 0; i < const_num_elements; i++)
{
auto variance = tffbn_variance->at<loco::DataType::FLOAT32>(i);
}
// fbn_rsqrt = 1.0 / math::sqrt(fbn_epsilon)
- std::unique_ptr<float> fbn_rsqrt{new float[const_num_elements]};
+ std::unique_ptr<float[]> fbn_rsqrt{new float[const_num_elements]};
for (int32_t i = 0; i < const_num_elements; i++)
{
fbn_rsqrt.get()[i] = 1.0 / sqrt(fbn_epsilon.get()[i]);
}
// fbn_mean = %3:mean : TODO remove this block and use %3:mean
- std::unique_ptr<float> fbn_mean{new float[const_num_elements]};
+ std::unique_ptr<float[]> fbn_mean{new float[const_num_elements]};
for (int32_t i = 0; i < const_num_elements; i++)
{
fbn_mean.get()[i] = tffbn_mean->at<loco::DataType::FLOAT32>(i);
}
// fbn_mul = fbn_rsqrt * %1:gamma
- std::unique_ptr<float> fbn_mul{new float[const_num_elements]};
+ std::unique_ptr<float[]> fbn_mul{new float[const_num_elements]};
for (int32_t i = 0; i < const_num_elements; i++)
{
fbn_mul.get()[i] = fbn_rsqrt.get()[i] * tffbn_gamma->at<loco::DataType::FLOAT32>(i);
}
// fbn_offset = %2:beta : TODO remove this block and use %2:beta
- std::unique_ptr<float> fbn_offset{new float[const_num_elements]};
+ std::unique_ptr<float[]> fbn_offset{new float[const_num_elements]};
for (int32_t i = 0; i < const_num_elements; i++)
{
fbn_offset.get()[i] = tffbn_beta->at<loco::DataType::FLOAT32>(i);
}
// fbn_mul_0_param = fbn_mul : remove this and use fbn_mul
- std::unique_ptr<float> fbn_mul_0_param{new float[const_num_elements]};
+ std::unique_ptr<float[]> fbn_mul_0_param{new float[const_num_elements]};
for (int32_t i = 0; i < const_num_elements; i++)
{
fbn_mul_0_param.get()[i] = fbn_mul.get()[i];
}
// fbn_add_param = fbn_offset - fbn_mean * fbn_mul
- std::unique_ptr<float> fbn_add_param{new float[const_num_elements]};
+ std::unique_ptr<float[]> fbn_add_param{new float[const_num_elements]};
for (int32_t i = 0; i < const_num_elements; i++)
{
fbn_add_param.get()[i] = fbn_offset.get()[i] - fbn_mean.get()[i] * fbn_mul.get()[i];