InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
frexp.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_FREXP_H_
2#define INFINI_OPS_BASE_FREXP_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class Frexp : public Operator<Frexp> {
9 public:
10 Frexp(const Tensor input, Tensor mantissa, Tensor exponent)
11 : input_shape_{input.shape()},
12 input_strides_{input.strides()},
13 input_type_{input.dtype()},
14 mantissa_shape_{mantissa.shape()},
15 mantissa_strides_{mantissa.strides()},
16 mantissa_type_{mantissa.dtype()},
17 exponent_shape_{exponent.shape()},
18 exponent_strides_{exponent.strides()},
19 exponent_type_{exponent.dtype()},
20 device_index_{mantissa.device().index()} {}
21
22 virtual void operator()(const Tensor input, Tensor mantissa,
23 Tensor exponent) 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 mantissa_shape_;
33
34 Tensor::Strides mantissa_strides_;
35
37
38 Tensor::Shape exponent_shape_;
39
40 Tensor::Strides exponent_strides_;
41
43
45};
46
47} // namespace infini::ops
48
49#endif
Definition frexp.h:8
DataType exponent_type_
Definition frexp.h:42
Frexp(const Tensor input, Tensor mantissa, Tensor exponent)
Definition frexp.h:10
Tensor::Shape input_shape_
Definition frexp.h:26
Tensor::Strides input_strides_
Definition frexp.h:28
Tensor::Strides mantissa_strides_
Definition frexp.h:34
DataType input_type_
Definition frexp.h:30
int device_index_
Definition frexp.h:44
Tensor::Shape mantissa_shape_
Definition frexp.h:32
Tensor::Strides exponent_strides_
Definition frexp.h:40
Tensor::Shape exponent_shape_
Definition frexp.h:38
virtual void operator()(const Tensor input, Tensor mantissa, Tensor exponent) const =0
DataType mantissa_type_
Definition frexp.h:36
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8