MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / expr

Class expr

dnn/include/megdnn/dtype/bfloat16.hpp:197–212  ·  view source on GitHub ↗

Temporary bfloat16 expression. This class represents a bfloat16 expression which just stores a single-precision value internally.

Source from the content-addressed store, hash-verified

195/// This class represents a bfloat16 expression which just stores a
196/// single-precision value internally.
197struct expr {
198 /// Conversion constructor.
199 /// \param f single-precision value to convert
200 MEGDNN_HOST MEGDNN_DEVICE explicit HALF_CONSTEXPR expr(float f)
201 : value_(f) {}
202
203 /// Conversion to single-precision.
204 /// \return single precision value representing expression value
205 MEGDNN_HOST MEGDNN_DEVICE HALF_CONSTEXPR operator float() const {
206 return value_;
207 }
208
209private:
210 /// Internal expression value stored in single-precision.
211 float value_;
212};
213
214/// SFINAE helper for generic bfloat16 functions.
215/// This class template has to be specialized for each valid combination of

Callers 15

plusMethod · 0.70
minusMethod · 0.70
multipliesMethod · 0.70
dividesMethod · 0.70
fmodMethod · 0.70
remainderMethod · 0.70
fdimMethod · 0.70
fmaMethod · 0.70
expMethod · 0.70
expm1Method · 0.70
exp2Method · 0.70
logMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected