Caffe2 - C++ API
A deep learning, cross platform ML framework
Related Pages
Modules
Data Structures
Files
C++ API
Python API
GitHub
File List
Globals
test
cpp_extensions
doubler.h
1
#include <torch/extension.h>
2
3
struct
Doubler
{
4
Doubler
(
int
A
,
int
B
) {
5
tensor_ =
6
torch::ones({A, B}, torch::dtype(torch::kFloat64).requires_grad(
true
));
7
}
8
torch::Tensor
forward() {
9
return
tensor_ * 2;
10
}
11
torch::Tensor
get
()
const
{
12
return
tensor_;
13
}
14
15
private
:
16
torch::Tensor
tensor_;
17
};
at::Tensor
Definition:
Tensor.h:48
Doubler
Definition:
doubler.h:3
A
Definition:
static.cpp:52
B
Definition:
static.cpp:58
Generated on Thu Mar 21 2019 13:06:22 for Caffe2 - C++ API by
1.8.11