Template Function mindspore::api::utils::isa

Function Documentation

template<typename T, typename = typename std::enable_if_t<std::is_base_of_v<Base, T> || is_wrapper_ptr<T>::value>>
inline bool mindspore::api::utils::isa(const BasePtr &ptr)

Check whether the given object is an instance of the given class.

参数

ptr[in] The pointer to the given object.

返回

True if the pointer is not null and the object is an instance of the given class, false otherwise.