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

Method as

imperative/src/impl/value.cpp:28–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28const Value* ValueRef::as(const IType& type) const {
29 auto&& storage = this->storage();
30 if (storage->type() != type) {
31 return nullptr;
32 }
33 return static_cast<Value*>(storage.get());
34}
35
36bool ValueRef::is(const IType& type) const {
37 return this->storage()->type() == type;

Callers 1

Calls 3

storageMethod · 0.80
typeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected