Caffe2 - C++ API
A deep learning, cross platform ML framework
functional.cpp
1 #include <torch/nn/modules/functional.h>
2 
3 #include <torch/types.h>
4 
5 #include <functional>
6 #include <utility>
7 
8 namespace torch {
9 namespace nn {
10 FunctionalImpl::FunctionalImpl(Function function)
11  : function_(std::move(function)) {}
12 
13 void FunctionalImpl::reset() {}
14 
15 void FunctionalImpl::pretty_print(std::ostream& stream) const {
16  stream << "torch::nn::Functional()";
17 }
18 
19 Tensor FunctionalImpl::forward(Tensor input) {
20  return function_(std::move(input));
21 }
22 
23 Tensor FunctionalImpl::operator()(Tensor input) {
24  return forward(std::move(input));
25 }
26 } // namespace nn
27 } // namespace torch
Tensor forward(const Tensor &indices)
Performs a lookup on the embedding table stored in weight using the indices supplied and returns the ...
Definition: embedding.cpp:33
Definition: jit_type.h:17