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

Function downcast_from

dnn/include/megdnn/dtype.h:598–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596#pragma GCC diagnostic ignored "-Wpragmas"
597#pragma GCC diagnostic ignored "-Wundefined-var-template"
598 static SelfType downcast_from(DType dtype) {
599 if (dtype.enumv() != type_enum) {
600 dtype.on_assert_is_failed(sm_trait.name);
601 }
602 return ParameterizedDType(dtype);
603 }
604#pragma GCC diagnostic pop
605
606 const DTypeParam<SelfType>& param() { return static_cast<Trait*>(m_trait)->param; }

Callers 2

TESTFunction · 0.85
asMethod · 0.85

Calls 3

on_assert_is_failedMethod · 0.80
ParameterizedDTypeFunction · 0.70
enumvMethod · 0.45

Tested by 1

TESTFunction · 0.68