Caffe2 - C++ API
A deep learning, cross platform ML framework
embedding_lookup.h
1 #pragma once
2 
3 #include "caffe2/core/common.h"
4 
5 namespace caffe2 {
6 
33 template <
34  typename IndexType,
35  typename InType,
36  typename OutType,
37  bool IS_WEIGHT_POSITIONAL = false>
38 void EmbeddingLookup(
39  const TIndex block_size,
40  const TIndex output_size,
41  const TIndex index_size,
42  const TIndex data_size,
43  const InType* input,
44  const IndexType* indices,
45  const int* lengths,
46  const float* weights, // optional, can be null for non-weighted sum
47  const float* scale_bias, // optional scale & bias params for uint8 input
48  bool normalize_by_lengths,
49  OutType* out);
50 
51 } // namespace caffe2
void EmbeddingLookup(const TIndex block_size, const TIndex output_size, const TIndex index_size, const TIndex data_size, const InType *input, const IndexType *indices, const int *lengths, const float *weights, const float *scale_bias, bool normalize_by_lengths, OutType *out)
Embedding lookup with reduction.
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...