@@ -12,7 +12,7 @@ namespace at {
12
12
// make sense. These are particularly useful for native functions,
13
13
// which do NO argument checking by default.
14
14
15
- struct AT_API TensorArg {
15
+ struct CAFFE2_API TensorArg {
16
16
Tensor tensor;
17
17
const char * name;
18
18
int pos; // 1-indexed
@@ -22,7 +22,7 @@ struct AT_API TensorArg {
22
22
const Tensor& operator *() const { return tensor; }
23
23
};
24
24
25
- struct AT_API TensorGeometryArg {
25
+ struct CAFFE2_API TensorGeometryArg {
26
26
TensorGeometry tensor;
27
27
const char * name;
28
28
int pos; // 1-indexed
@@ -49,40 +49,80 @@ using CheckedFrom = const char*;
49
49
// not TensorGeometryArg, because the Tensor to TensorGeometry
50
50
// conversion will blow up if you have undefined tensors.
51
51
52
- AT_API std::ostream& operator <<(std::ostream & out, TensorGeometryArg t);
53
- AT_API void checkDim (CheckedFrom c, const TensorGeometryArg& t, int64_t dim);
52
+ CAFFE2_API std::ostream& operator <<(std::ostream& out, TensorGeometryArg t);
53
+ CAFFE2_API void checkDim (
54
+ CheckedFrom c,
55
+ const TensorGeometryArg& t,
56
+ int64_t dim);
54
57
// NB: this is an inclusive-exclusive range
55
- AT_API void checkDimRange (CheckedFrom c, const TensorGeometryArg& t, int64_t dim_start, int64_t dim_end);
56
- AT_API void checkSameDim (CheckedFrom c, const TensorGeometryArg& t1, const TensorGeometryArg& t2);
57
- AT_API void checkContiguous (CheckedFrom c, const TensorGeometryArg& t);
58
- AT_API void checkAllContiguous (CheckedFrom c, at::ArrayRef<TensorArg> ts);
59
- AT_API void checkSize (CheckedFrom c, const TensorGeometryArg& t, IntList sizes);
60
- AT_API void checkSize (CheckedFrom c, const TensorGeometryArg& t, int64_t dim, int64_t size);
61
- AT_API void checkNumel (CheckedFrom c, const TensorGeometryArg& t, int64_t numel);
62
- AT_API void checkSameNumel (CheckedFrom c, const TensorGeometryArg& t1, const TensorGeometryArg& t2);
63
- AT_API void checkAllSameNumel (CheckedFrom c, ArrayRef<TensorArg> tensors);
64
- AT_API void checkScalarType (CheckedFrom c, const TensorArg& t, ScalarType s);
65
- AT_API void checkScalarTypes (CheckedFrom c, const TensorArg& t, at::ArrayRef<ScalarType> l);
66
- AT_API void checkSameGPU (CheckedFrom c, const TensorArg& t1, const TensorArg& t2);
67
- AT_API void checkAllSameGPU (CheckedFrom c, ArrayRef<TensorArg> tensors);
68
- AT_API void checkSameType (CheckedFrom c, const TensorArg& t1, const TensorArg& t2);
69
- AT_API void checkAllSameType (CheckedFrom c, ArrayRef<TensorArg> tensors);
70
- AT_API void checkSameSize (CheckedFrom c, const TensorArg& t1, const TensorArg& t2);
71
- AT_API void checkDefined (CheckedFrom c, const TensorArg& t);
72
- AT_API void checkAllDefined (CheckedFrom c, at::ArrayRef<TensorArg> t);
58
+ CAFFE2_API void checkDimRange (
59
+ CheckedFrom c,
60
+ const TensorGeometryArg& t,
61
+ int64_t dim_start,
62
+ int64_t dim_end);
63
+ CAFFE2_API void checkSameDim (
64
+ CheckedFrom c,
65
+ const TensorGeometryArg& t1,
66
+ const TensorGeometryArg& t2);
67
+ CAFFE2_API void checkContiguous (CheckedFrom c, const TensorGeometryArg& t);
68
+ CAFFE2_API void checkAllContiguous (CheckedFrom c, at::ArrayRef<TensorArg> ts);
69
+ CAFFE2_API void checkSize (
70
+ CheckedFrom c,
71
+ const TensorGeometryArg& t,
72
+ IntList sizes);
73
+ CAFFE2_API void checkSize (
74
+ CheckedFrom c,
75
+ const TensorGeometryArg& t,
76
+ int64_t dim,
77
+ int64_t size);
78
+ CAFFE2_API void checkNumel (
79
+ CheckedFrom c,
80
+ const TensorGeometryArg& t,
81
+ int64_t numel);
82
+ CAFFE2_API void checkSameNumel (
83
+ CheckedFrom c,
84
+ const TensorGeometryArg& t1,
85
+ const TensorGeometryArg& t2);
86
+ CAFFE2_API void checkAllSameNumel (CheckedFrom c, ArrayRef<TensorArg> tensors);
87
+ CAFFE2_API void checkScalarType (
88
+ CheckedFrom c,
89
+ const TensorArg& t,
90
+ ScalarType s);
91
+ CAFFE2_API void checkScalarTypes (
92
+ CheckedFrom c,
93
+ const TensorArg& t,
94
+ at::ArrayRef<ScalarType> l);
95
+ CAFFE2_API void checkSameGPU (
96
+ CheckedFrom c,
97
+ const TensorArg& t1,
98
+ const TensorArg& t2);
99
+ CAFFE2_API void checkAllSameGPU (CheckedFrom c, ArrayRef<TensorArg> tensors);
100
+ CAFFE2_API void checkSameType (
101
+ CheckedFrom c,
102
+ const TensorArg& t1,
103
+ const TensorArg& t2);
104
+ CAFFE2_API void checkAllSameType (CheckedFrom c, ArrayRef<TensorArg> tensors);
105
+ CAFFE2_API void checkSameSize (
106
+ CheckedFrom c,
107
+ const TensorArg& t1,
108
+ const TensorArg& t2);
109
+ CAFFE2_API void checkDefined (CheckedFrom c, const TensorArg& t);
110
+ CAFFE2_API void checkAllDefined (CheckedFrom c, at::ArrayRef<TensorArg> t);
73
111
74
112
// FixMe: does TensorArg slow things down?
75
- AT_API void checkBackend (CheckedFrom c, at::ArrayRef<Tensor> t, at::Backend backend);
113
+ CAFFE2_API void checkBackend (
114
+ CheckedFrom c,
115
+ at::ArrayRef<Tensor> t,
116
+ at::Backend backend);
76
117
77
118
// Methods for getting data_ptr if tensor is defined
78
- AT_API void * maybe_data_ptr (const Tensor& tensor);
79
- AT_API void * maybe_data_ptr (const TensorArg& tensor);
119
+ CAFFE2_API void * maybe_data_ptr (const Tensor& tensor);
120
+ CAFFE2_API void * maybe_data_ptr (const TensorArg& tensor);
80
121
81
122
// Return if the tensor geometry represented by `sizes` and `strides` is contiguous
82
123
// Although we cache is_contiguous in tensor now, this is till useful because it
83
124
// allows checking if a particular geometry is contiguous without explicitly
84
125
// constructing a tensor, e.g., when you want to choose a kernel strategy based
85
126
// on whether a subgeometry is contiguous.
86
- AT_API bool geometry_is_contiguous (IntList sizes, IntList strides);
87
-
127
+ CAFFE2_API bool geometry_is_contiguous (IntList sizes, IntList strides);
88
128
}
0 commit comments