throw InvalidArgumentException("AddQLstmLayer: Projection Weights cannot be NULL");
}
- if(params.m_ProjectionBias == nullptr)
+ layer->m_ProjectionParameters.m_ProjectionWeights =
+ std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionWeights));
+
+ // Projection bias is optional even if projection is enabled
+ if(params.m_ProjectionWeights != nullptr)
{
- throw InvalidArgumentException("AddQLstmLayer: Projection Biases cannot be NULL");
+ layer->m_ProjectionParameters.m_ProjectionBias =
+ std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionBias));
}
- layer->m_ProjectionParameters.m_ProjectionWeights =
- std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionWeights));
- layer->m_ProjectionParameters.m_ProjectionBias =
- std::make_unique<ScopedCpuTensorHandle>(*(params.m_ProjectionBias));
}
// QLstm Peephole params
{
ARMNN_ASSERT_MSG(m_ProjectionParameters.m_ProjectionWeights != nullptr,
"QLstmLayer: m_ProjectionParameters.m_ProjectionWeights should not be null.");
- ARMNN_ASSERT_MSG(m_ProjectionParameters.m_ProjectionBias != nullptr,
- "QLstmLayer: m_ProjectionParameters.m_ProjectionBias should not be null.");
}
if (m_Param.m_PeepholeEnabled)
if(descriptor.m_ProjectionEnabled)
{
paramsInfo.m_ProjectionWeights = &cLayer->m_ProjectionParameters.m_ProjectionWeights->GetTensorInfo();
- paramsInfo.m_ProjectionBias = &cLayer->m_ProjectionParameters.m_ProjectionBias->GetTensorInfo();
+
+ // Projection bias is optional even if projection is enabled
+ if (cLayer->m_ProjectionParameters.m_ProjectionBias != nullptr)
+ {
+ paramsInfo.m_ProjectionBias = &cLayer->m_ProjectionParameters.m_ProjectionBias->GetTensorInfo();
+ }
}
if(descriptor.m_PeepholeEnabled)