ONE - On-device Neural Engine
Loading...
Searching...
No Matches
mir_interpreter::MaxImpl< T > Struct Template Reference

Static Public Member Functions

static void run (const TensorVariant &lhs, const TensorVariant &rhs, TensorVariant &res)
 

Detailed Description

template<typename T>
struct mir_interpreter::MaxImpl< T >

Definition at line 30 of file Max.cpp.

Member Function Documentation

◆ run()

template<typename T >
void mir_interpreter::MaxImpl< T >::run ( const TensorVariant lhs,
const TensorVariant rhs,
TensorVariant res 
)
static

Definition at line 36 of file Max.cpp.

37{
38 TensorVariant broadcasted_lhs(lhs, res.getShape());
39 TensorVariant broadcasted_rhs(rhs, res.getShape());
40 Tensor<T> lhs_accessor(broadcasted_lhs);
41 Tensor<T> rhs_accessor(broadcasted_rhs);
42 Tensor<T> res_accessor(res);
43
44 for (const auto &index : ShapeRange(res.getShape()))
45 {
46 res_accessor.at(index) = std::max(lhs_accessor.at(index), rhs_accessor.at(index));
47 }
48}
nnfw::cker::Shape getShape(const IPortableTensor *tensor)

References mir::Tensor< T >::at(), and mir::TensorVariant::getShape().

Referenced by package.infer.session::inference().


The documentation for this struct was generated from the following file: