Skip to content

Commit d6076bc

Browse files
committed
feat: add fractional_max_pool3d base
1 parent 832e048 commit d6076bc

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

src/base/fractional_max_pool3d.h

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// AUTO-GENERATED by `scripts/generate_torch_ops.py` — DO NOT EDIT.
2+
#ifndef INFINI_OPS_BASE_FRACTIONAL_MAX_POOL3D_H_
3+
#define INFINI_OPS_BASE_FRACTIONAL_MAX_POOL3D_H_
4+
5+
#include "operator.h"
6+
7+
namespace infini::ops {
8+
9+
class FractionalMaxPool3d : public Operator<FractionalMaxPool3d> {
10+
public:
11+
FractionalMaxPool3d(const Tensor input, const std::vector<int64_t> kernel_size, const std::vector<int64_t> output_size, const Tensor random_samples, Tensor output, Tensor indices)
12+
: input_shape_{input.shape()},
13+
input_strides_{input.strides()},
14+
input_type_{input.dtype()},
15+
random_samples_shape_{random_samples.shape()},
16+
random_samples_strides_{random_samples.strides()},
17+
random_samples_type_{random_samples.dtype()},
18+
output_shape_{output.shape()},
19+
output_strides_{output.strides()},
20+
output_type_{output.dtype()},
21+
indices_shape_{indices.shape()},
22+
indices_strides_{indices.strides()},
23+
indices_type_{indices.dtype()},
24+
kernel_size_{kernel_size},
25+
output_size_{output_size},
26+
device_index_{output.device().index()} {}
27+
28+
virtual void operator()(const Tensor input, const std::vector<int64_t> kernel_size, const std::vector<int64_t> output_size, const Tensor random_samples, Tensor output, Tensor indices) const = 0;
29+
30+
protected:
31+
Tensor::Shape input_shape_;
32+
33+
Tensor::Strides input_strides_;
34+
35+
DataType input_type_;
36+
37+
Tensor::Shape random_samples_shape_;
38+
39+
Tensor::Strides random_samples_strides_;
40+
41+
DataType random_samples_type_;
42+
43+
Tensor::Shape output_shape_;
44+
45+
Tensor::Strides output_strides_;
46+
47+
DataType output_type_;
48+
49+
Tensor::Shape indices_shape_;
50+
51+
Tensor::Strides indices_strides_;
52+
53+
DataType indices_type_;
54+
55+
std::vector<int64_t> kernel_size_{};
56+
57+
std::vector<int64_t> output_size_{};
58+
59+
int device_index_{0};
60+
};
61+
62+
} // namespace infini::ops
63+
64+
#endif

0 commit comments

Comments
 (0)