Caffe2 - C++ API
A deep learning, cross platform ML framework
embedding_lookup.h
1 
17 #pragma once
18 
19 #include "caffe2/core/common.h"
20 
21 namespace caffe2 {
22 
49 template <typename IndexType, typename InType, typename OutType>
50 void EmbeddingLookup(
51  const TIndex block_size,
52  const TIndex output_size,
53  const TIndex index_size,
54  const TIndex data_size,
55  const InType* input,
56  const IndexType* indices,
57  const int* lengths,
58  const float* weights, // optional, can be null for non-weighted sum
59  const float* scale_bias, // optional scale & bias params for uint8 input
60  bool normalize_by_lengths,
61  OutType* out);
62 
63 } // namespace caffe2
Copyright (c) 2016-present, Facebook, Inc.
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.