aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/NEON/functions/NELSTMLayer.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2020-06-16 17:44:46 +0100
committerMichalis Spyrou <michalis.spyrou@arm.com>2020-06-17 09:29:40 +0000
commit1fd2c80692ed8ecefc4d8deb783564ad19eaf70c (patch)
treeb44219bdc8bdc17cb2906dd50a5ba1ee1e6b12fc /src/runtime/NEON/functions/NELSTMLayer.cpp
parent27a9e4f10516679bc6e92bec104ae219e1fa7f15 (diff)
downloadComputeLibrary-1fd2c80692ed8ecefc4d8deb783564ad19eaf70c.tar.gz
COMPMID-3375: Port NEActivationLayer functions/kernels to run on
different tensors. Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Change-Id: I98782bb73e9dc0899ffb1796aca6f99714adea94 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3343 Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NELSTMLayer.cpp')
-rw-r--r--src/runtime/NEON/functions/NELSTMLayer.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/runtime/NEON/functions/NELSTMLayer.cpp b/src/runtime/NEON/functions/NELSTMLayer.cpp
index f9d445fe71..0a111363e3 100644
--- a/src/runtime/NEON/functions/NELSTMLayer.cpp
+++ b/src/runtime/NEON/functions/NELSTMLayer.cpp
@@ -474,7 +474,7 @@ Status NELSTMLayer::validate(const ITensorInfo *input,
RoundingPolicy::TO_ZERO));
ARM_COMPUTE_RETURN_ON_ERROR(NEArithmeticAddition::validate(&forget_gate, forget_gate_bias, &forget_gate, ConvertPolicy::SATURATE));
}
- ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayerKernel::validate(&forget_gate, &forget_gate, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC)));
+ ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayer::validate(&forget_gate, &forget_gate, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC)));
// Validate input gate
if(!lstm_params.has_cifg_opt())
@@ -508,7 +508,7 @@ Status NELSTMLayer::validate(const ITensorInfo *input,
ARM_COMPUTE_RETURN_ON_ERROR(NEPixelWiseMultiplicationKernel::validate(&input_gate, lstm_params.input_layer_norm_weights(), &input_gate, 1, ConvertPolicy::SATURATE, RoundingPolicy::TO_ZERO));
ARM_COMPUTE_RETURN_ON_ERROR(NEArithmeticAddition::validate(&input_gate, lstm_params.input_gate_bias(), &input_gate, ConvertPolicy::SATURATE));
}
- ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayerKernel::validate(&input_gate, nullptr, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC)));
+ ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayer::validate(&input_gate, nullptr, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC)));
}
else
{
@@ -526,14 +526,14 @@ Status NELSTMLayer::validate(const ITensorInfo *input,
RoundingPolicy::TO_ZERO));
ARM_COMPUTE_RETURN_ON_ERROR(NEArithmeticAddition::validate(&cell_state_tmp, cell_bias, &cell_state_tmp, ConvertPolicy::SATURATE));
}
- ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayerKernel::validate(&cell_state_tmp, nullptr, activation_info));
+ ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayer::validate(&cell_state_tmp, nullptr, activation_info));
ARM_COMPUTE_RETURN_ON_ERROR(NEPixelWiseMultiplicationKernel::validate(&cell_state_tmp, &input_gate, &cell_state_tmp, 1, ConvertPolicy::SATURATE, RoundingPolicy::TO_ZERO));
ARM_COMPUTE_RETURN_ON_ERROR(NEPixelWiseMultiplicationKernel::validate(&cell_state_tmp, &forget_gate, &cell_state_tmp, 1, ConvertPolicy::SATURATE, RoundingPolicy::TO_ZERO));
ARM_COMPUTE_RETURN_ON_ERROR(NEArithmeticAddition::validate(&cell_state_tmp, &cell_state_tmp, &cell_state_tmp, ConvertPolicy::SATURATE));
if(cell_threshold != 0.f)
{
- ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayerKernel::validate(&cell_state_tmp, nullptr, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, -cell_threshold,
- cell_threshold)));
+ ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayer::validate(&cell_state_tmp, nullptr, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, -cell_threshold,
+ cell_threshold)));
}
// Validate output gate tmp
@@ -559,18 +559,18 @@ Status NELSTMLayer::validate(const ITensorInfo *input,
RoundingPolicy::TO_ZERO));
ARM_COMPUTE_RETURN_ON_ERROR(NEArithmeticAddition::validate(&output_gate_tmp, output_gate_bias, &output_gate_tmp, ConvertPolicy::SATURATE));
}
- ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayerKernel::validate(&output_gate_tmp, nullptr, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC)));
+ ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayer::validate(&output_gate_tmp, nullptr, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC)));
// Validate output state
- ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayerKernel::validate(&cell_state_tmp, &cell_state_tmp, activation_info));
+ ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayer::validate(&cell_state_tmp, &cell_state_tmp, activation_info));
ARM_COMPUTE_RETURN_ON_ERROR(NEPixelWiseMultiplicationKernel::validate(&cell_state_tmp, &output_gate_tmp, &output_gate_tmp, 1, ConvertPolicy::SATURATE, RoundingPolicy::TO_ZERO));
if(lstm_params.has_projection())
{
ARM_COMPUTE_RETURN_ON_ERROR(NEFullyConnectedLayer::validate(&output_gate_tmp, lstm_params.projection_weights(), lstm_params.projection_bias(), output_state_out));
if(projection_threshold != 0.f)
{
- ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayerKernel::validate(output_state_out, output_state_out,
- ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, -projection_threshold, projection_threshold)));
+ ARM_COMPUTE_RETURN_ON_ERROR(NEActivationLayer::validate(output_state_out, output_state_out,
+ ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, -projection_threshold, projection_threshold)));
}
}
@@ -612,7 +612,7 @@ void NELSTMLayer::run()
NEScheduler::get().schedule(&_pixelwise_mul_forget_gate_coeff, Window::DimY);
NEScheduler::get().schedule(&_accum_forget_gate_bias, Window::DimY);
}
- NEScheduler::get().schedule(&_activation_forget_gate, Window::DimY);
+ _activation_forget_gate.run();
if(_run_cifg_opt)
{
@@ -642,7 +642,7 @@ void NELSTMLayer::run()
NEScheduler::get().schedule(&_pixelwise_mul_input_gate_coeff, Window::DimY);
NEScheduler::get().schedule(&_accum_input_gate_bias, Window::DimY);
}
- NEScheduler::get().schedule(&_activation_input_gate, Window::DimY);
+ _activation_input_gate.run();
}
_fully_connected_cell_state.run();
@@ -655,14 +655,14 @@ void NELSTMLayer::run()
NEScheduler::get().schedule(&_pixelwise_mul_cell_gate_coeff, Window::DimY);
NEScheduler::get().schedule(&_accum_cell_gate_bias, Window::DimY);
}
- NEScheduler::get().schedule(&_activation_cell_state, Window::DimY);
+ _activation_cell_state.run();
NEScheduler::get().schedule(&_pixelwise_mul_cell_state1, Window::DimY);
NEScheduler::get().schedule(&_pixelwise_mul_cell_state2, Window::DimY);
NEScheduler::get().schedule(&_accum_cell_state2, Window::DimY);
if(_perform_cell_clipping)
{
- NEScheduler::get().schedule(&_cell_clip, Window::DimY);
+ _cell_clip.run();
}
_fully_connected_output.run();
@@ -677,9 +677,9 @@ void NELSTMLayer::run()
NEScheduler::get().schedule(&_pixelwise_mul_output_gate_coeff, Window::DimY);
NEScheduler::get().schedule(&_accum_output_gate_bias, Window::DimY);
}
- NEScheduler::get().schedule(&_activation_output, Window::DimY);
+ _activation_output.run();
- NEScheduler::get().schedule(&_activation_output_state, Window::DimY);
+ _activation_output_state.run();
NEScheduler::get().schedule(&_pixelwise_mul_output_state2, Window::DimY);
if(_has_projection_weights)
@@ -687,7 +687,7 @@ void NELSTMLayer::run()
_fully_connected_output_state.run();
if(_perform_projection_clipping)
{
- NEScheduler::get().schedule(&_projection_clip, Window::DimY);
+ _projection_clip.run();
}
}