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.

Parameters

ptr[in] The pointer to the given object.

Returns

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