12 #include <boost/core/ignore_unused.hpp> 13 #include <boost/numeric/conversion/cast.hpp> 22 const int32_t* indices,
25 boost::ignore_unused(outputInfo);
28 unsigned int paramsProduct = 1;
31 paramsProduct = paramsProduct * paramsShape[i];
34 unsigned int outIndex = 0;
37 unsigned int indx = boost::numeric_cast<
unsigned int>(indices[i]);
39 BOOST_ASSERT(indices[i] >= 0 && indx < paramsShape[0]);
41 unsigned int startOffset = indx * paramsProduct;
42 unsigned int endOffset = startOffset + paramsProduct;
44 for (
unsigned int j = startOffset; j < endOffset; ++j)
47 float outputValue = params.
Get();
49 output.
Set(outputValue);
unsigned int GetNumDimensions() const
void Gather(const TensorInfo ¶msInfo, const TensorInfo &indicesInfo, const TensorInfo &outputInfo, Decoder< float > ¶ms, const int32_t *indices, Encoder< float > &output)
unsigned int GetNumElements() const
virtual IType Get() const =0
const TensorShape & GetShape() const
virtual void Set(IType right)=0