InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
special_logit.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_SPECIAL_LOGIT_H_
2#define INFINI_OPS_BASE_SPECIAL_LOGIT_H_
3
4#include <optional>
5
6#include "operator.h"
7
8namespace infini::ops::special {
9
10class Logit : public Operator<Logit> {
11 public:
12 Logit(const Tensor input, const std::optional<double> eps, Tensor out)
13 : input_shape_{input.shape()},
14 input_strides_{input.strides()},
15 input_type_{input.dtype()},
16 out_shape_{out.shape()},
17 out_strides_{out.strides()},
18 out_type_{out.dtype()},
19 eps_{eps},
20 device_index_{out.device().index()} {}
21
22 virtual void operator()(const Tensor input, const std::optional<double> eps,
23 Tensor out) const = 0;
24
25 protected:
26 Tensor::Shape input_shape_;
27
28 Tensor::Strides input_strides_;
29
30 DataType input_type_;
31
32 Tensor::Shape out_shape_;
33
34 Tensor::Strides out_strides_;
35
36 DataType out_type_;
37
38 std::optional<double> eps_{};
39
41};
42
43} // namespace infini::ops::special
44
45#endif
Definition generated/include/operator.h:282
Definition special_logit.h:10
Logit(const Tensor input, const std::optional< double > eps, Tensor out)
Definition special_logit.h:12
Tensor::Strides out_strides_
Definition special_logit.h:34
DataType input_type_
Definition special_logit.h:30
Tensor::Shape out_shape_
Definition special_logit.h:32
DataType out_type_
Definition special_logit.h:36
virtual void operator()(const Tensor input, const std::optional< double > eps, Tensor out) const =0
Tensor::Strides input_strides_
Definition special_logit.h:28
Tensor::Shape input_shape_
Definition special_logit.h:26
std::optional< double > eps_
Definition special_logit.h:38
int device_index_
Definition special_logit.h:40
Definition special_airy_ai.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8