Caffe2 - C++ API
A deep learning, cross platform ML framework
Functions.h
1 #pragma once
2 
3 // ${generated_comment}
4 
5 #include <c10/core/Scalar.h>
6 #include <ATen/Type.h>
7 #include <ATen/TypeExtendedInterface.h>
8 #include <ATen/Tensor.h>
9 #include <c10/core/Storage.h>
10 #include <ATen/core/Generator.h>
11 #include <c10/util/Deprecated.h>
12 #include <ATen/NativeFunctions.h>
13 #include <ATen/DeviceGuard.h>
14 #include <c10/core/TensorOptions.h>
15 #include <ATen/core/Reduction.h>
16 #include <c10/util/Optional.h>
17 
18 namespace at {
19 
20 using native::from_blob;
21 using native::tensor;
22 
23 ${function_declarations}
24 
25 namespace detail {
26 
27 static inline TypeExtendedInterface & infer_type(const Tensor & t) {
28  AT_CHECK(t.defined(), "undefined Tensor");
29  return getType(t);
30 }
31 static inline TypeExtendedInterface & infer_type(const TensorList & tl) {
32  AT_CHECK(tl.size() > 0, "expected a non-empty list of Tensors");
33  return getType(tl[0]);
34 }
35 
36 } // namespace detail
37 
38 // function definitions are all static inline because
39 // they are one-line statically dispatched functions that
40 // invoke the actual dynamic dispatch on the correct argument
41 ${function_definitions}
42 
43 }
Flush-To-Zero and Denormals-Are-Zero mode.