Unverified Commit 6c53f351 authored by Hongzhi (Steve), Chen's avatar Hongzhi (Steve), Chen Committed by GitHub
Browse files

Replace \xxx with @XXX in structured comment. (#4815)



* replace

* more

* file

* change
Co-authored-by: default avatarSteve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
parent 33a2d9e1
/*! /*!
* Copyright (c) 2019 by Contributors * Copyright (c) 2019 by Contributors
* \file dgl/runtime/c_object_api.h * @file dgl/runtime/c_object_api.h
* *
* \brief DGL Object C API, used to extend and prototype new CAPIs. * @brief DGL Object C API, used to extend and prototype new CAPIs.
* *
* \note Most API functions are registerd as PackedFunc and * @note Most API functions are registerd as PackedFunc and
* can be grabbed via DGLFuncGetGlobal * can be grabbed via DGLFuncGetGlobal
*/ */
#ifndef DGL_RUNTIME_C_OBJECT_API_H_ #ifndef DGL_RUNTIME_C_OBJECT_API_H_
...@@ -16,52 +16,52 @@ ...@@ -16,52 +16,52 @@
extern "C" { extern "C" {
#endif #endif
/*! \brief handle to object */ /*! @brief handle to object */
typedef void* ObjectHandle; typedef void* ObjectHandle;
/*! /*!
* \brief free the object handle * @brief free the object handle
* \param handle The object handle to be freed. * @param handle The object handle to be freed.
* \return 0 when success, -1 when failure happens * @return 0 when success, -1 when failure happens
*/ */
DGL_DLL int DGLObjectFree(ObjectHandle handle); DGL_DLL int DGLObjectFree(ObjectHandle handle);
/*! /*!
* \brief Convert type key to type index. * @brief Convert type key to type index.
* \param type_key The key of the type. * @param type_key The key of the type.
* \param out_index the corresponding type index. * @param out_index the corresponding type index.
* \return 0 when success, -1 when failure happens * @return 0 when success, -1 when failure happens
*/ */
DGL_DLL int DGLObjectTypeKey2Index(const char* type_key, int* out_index); DGL_DLL int DGLObjectTypeKey2Index(const char* type_key, int* out_index);
/*! /*!
* \brief Get runtime type index of the object. * @brief Get runtime type index of the object.
* \param handle the object handle. * @param handle the object handle.
* \param out_index the corresponding type index. * @param out_index the corresponding type index.
* \return 0 when success, -1 when failure happens * @return 0 when success, -1 when failure happens
*/ */
DGL_DLL int DGLObjectGetTypeIndex(ObjectHandle handle, int* out_index); DGL_DLL int DGLObjectGetTypeIndex(ObjectHandle handle, int* out_index);
/*! /*!
* \brief get attributes given key * @brief get attributes given key
* \param handle The object handle * @param handle The object handle
* \param key The attribute name * @param key The attribute name
* \param out_value The attribute value * @param out_value The attribute value
* \param out_type_code The type code of the attribute. * @param out_type_code The type code of the attribute.
* \param out_success Whether get is successful. * @param out_success Whether get is successful.
* \return 0 when success, -1 when failure happens * @return 0 when success, -1 when failure happens
* \note API calls always exchanges with type bits=64, lanes=1 * @note API calls always exchanges with type bits=64, lanes=1
*/ */
DGL_DLL int DGLObjectGetAttr( DGL_DLL int DGLObjectGetAttr(
ObjectHandle handle, const char* key, DGLValue* out_value, ObjectHandle handle, const char* key, DGLValue* out_value,
int* out_type_code, int* out_success); int* out_type_code, int* out_success);
/*! /*!
* \brief get attributes names in the object. * @brief get attributes names in the object.
* \param handle The object handle * @param handle The object handle
* \param out_size The number of functions * @param out_size The number of functions
* \param out_array The array of function names. * @param out_array The array of function names.
* \return 0 when success, -1 when failure happens * @return 0 when success, -1 when failure happens
*/ */
DGL_DLL int DGLObjectListAttrNames( DGL_DLL int DGLObjectListAttrNames(
ObjectHandle handle, int* out_size, const char*** out_array); ObjectHandle handle, int* out_size, const char*** out_array);
......
This diff is collapsed.
/*! /*!
* Copyright (c) 2019 by Contributors * Copyright (c) 2019 by Contributors
* \file runtime/config.h * @file runtime/config.h
* \brief DGL runtime config * @brief DGL runtime config
*/ */
#ifndef DGL_RUNTIME_CONFIG_H_ #ifndef DGL_RUNTIME_CONFIG_H_
......
/*! /*!
* Copyright (c) 2019 by Contributors * Copyright (c) 2019 by Contributors
* \file runtime/container.h * @file runtime/container.h
* \brief Defines the container object data structures. * @brief Defines the container object data structures.
*/ */
#ifndef DGL_RUNTIME_CONTAINER_H_ #ifndef DGL_RUNTIME_CONTAINER_H_
#define DGL_RUNTIME_CONTAINER_H_ #define DGL_RUNTIME_CONTAINER_H_
...@@ -19,21 +19,21 @@ namespace dgl { ...@@ -19,21 +19,21 @@ namespace dgl {
namespace runtime { namespace runtime {
/*! /*!
* \brief value object. * @brief value object.
* *
* It is typically used to wrap a non-Object type to Object type. * It is typically used to wrap a non-Object type to Object type.
* Any type that is supported by DGLRetValue is supported by this. * Any type that is supported by DGLRetValue is supported by this.
*/ */
class ValueObject : public Object { class ValueObject : public Object {
public: public:
/*! \brief the value data */ /*! @brief the value data */
DGLRetValue data; DGLRetValue data;
static constexpr const char* _type_key = "Value"; static constexpr const char* _type_key = "Value";
DGL_DECLARE_OBJECT_TYPE_INFO(ValueObject, Object); DGL_DECLARE_OBJECT_TYPE_INFO(ValueObject, Object);
}; };
/*! \brief Construct a value object. */ /*! @brief Construct a value object. */
template <typename T> template <typename T>
inline std::shared_ptr<ValueObject> MakeValue(T&& val) { inline std::shared_ptr<ValueObject> MakeValue(T&& val) {
auto obj = std::make_shared<ValueObject>(); auto obj = std::make_shared<ValueObject>();
...@@ -41,7 +41,7 @@ inline std::shared_ptr<ValueObject> MakeValue(T&& val) { ...@@ -41,7 +41,7 @@ inline std::shared_ptr<ValueObject> MakeValue(T&& val) {
return obj; return obj;
} }
/*! \brief Vallue reference type */ /*! @brief Vallue reference type */
class Value : public ObjectRef { class Value : public ObjectRef {
public: public:
Value() {} Value() {}
...@@ -54,10 +54,10 @@ class Value : public ObjectRef { ...@@ -54,10 +54,10 @@ class Value : public ObjectRef {
using ContainerType = ValueObject; using ContainerType = ValueObject;
}; };
/*! \brief list obj content in list */ /*! @brief list obj content in list */
class ListObject : public Object { class ListObject : public Object {
public: public:
/*! \brief the data content */ /*! @brief the data content */
std::vector<std::shared_ptr<Object> > data; std::vector<std::shared_ptr<Object> > data;
void VisitAttrs(AttrVisitor* visitor) final { void VisitAttrs(AttrVisitor* visitor) final {
...@@ -68,7 +68,7 @@ class ListObject : public Object { ...@@ -68,7 +68,7 @@ class ListObject : public Object {
DGL_DECLARE_OBJECT_TYPE_INFO(ListObject, Object); DGL_DECLARE_OBJECT_TYPE_INFO(ListObject, Object);
}; };
/*! \brief map obj content */ /*! @brief map obj content */
class MapObject : public Object { class MapObject : public Object {
public: public:
void VisitAttrs(AttrVisitor* visitor) final { void VisitAttrs(AttrVisitor* visitor) final {
...@@ -89,28 +89,28 @@ class MapObject : public Object { ...@@ -89,28 +89,28 @@ class MapObject : public Object {
} }
}; };
/*! \brief The corresponding conatiner type */ /*! @brief The corresponding conatiner type */
using ContainerType = std::unordered_map< using ContainerType = std::unordered_map<
std::shared_ptr<Object>, std::shared_ptr<Object>, Hash, Equal>; std::shared_ptr<Object>, std::shared_ptr<Object>, Hash, Equal>;
/*! \brief the data content */ /*! @brief the data content */
ContainerType data; ContainerType data;
static constexpr const char* _type_key = "Map"; static constexpr const char* _type_key = "Map";
DGL_DECLARE_OBJECT_TYPE_INFO(MapObject, Object); DGL_DECLARE_OBJECT_TYPE_INFO(MapObject, Object);
}; };
/*! \brief specialized map obj with string as key */ /*! @brief specialized map obj with string as key */
class StrMapObject : public Object { class StrMapObject : public Object {
public: public:
void VisitAttrs(AttrVisitor* visitor) final { void VisitAttrs(AttrVisitor* visitor) final {
// Visitor to map have no effect. // Visitor to map have no effect.
} }
/*! \brief The corresponding conatiner type */ /*! @brief The corresponding conatiner type */
using ContainerType = using ContainerType =
std::unordered_map<std::string, std::shared_ptr<Object> >; std::unordered_map<std::string, std::shared_ptr<Object> >;
/*! \brief the data content */ /*! @brief the data content */
ContainerType data; ContainerType data;
static constexpr const char* _type_key = "StrMap"; static constexpr const char* _type_key = "StrMap";
...@@ -118,9 +118,9 @@ class StrMapObject : public Object { ...@@ -118,9 +118,9 @@ class StrMapObject : public Object {
}; };
/*! /*!
* \brief iterator adapter that adapts TIter to return another type. * @brief iterator adapter that adapts TIter to return another type.
* \tparam Converter a struct that contains converting function * @tparam Converter a struct that contains converting function
* \tparam TIter the content iterator type. * @tparam TIter the content iterator type.
*/ */
template <typename Converter, typename TIter> template <typename Converter, typename TIter>
class IterAdapter { class IterAdapter {
...@@ -150,7 +150,7 @@ class IterAdapter { ...@@ -150,7 +150,7 @@ class IterAdapter {
}; };
/*! /*!
* \brief List container of ObjectRef. * @brief List container of ObjectRef.
* *
* List implements copy on write semantics, which means list is mutable * List implements copy on write semantics, which means list is mutable
* but copy will happen when list is referenced in more than two places. * but copy will happen when list is referenced in more than two places.
...@@ -161,9 +161,9 @@ class IterAdapter { ...@@ -161,9 +161,9 @@ class IterAdapter {
* *
* operator[] only provide const access, use Set to mutate the content. * operator[] only provide const access, use Set to mutate the content.
* *
* \tparam T The content ObjectRef type. * @tparam T The content ObjectRef type.
* *
* \note The element type must subclass \c ObjectRef. Otherwise, the * @note The element type must subclass \c ObjectRef. Otherwise, the
* compiler would throw an error: * compiler would throw an error:
* *
* <code> * <code>
...@@ -188,53 +188,53 @@ template < ...@@ -188,53 +188,53 @@ template <
class List : public ObjectRef { class List : public ObjectRef {
public: public:
/*! /*!
* \brief default constructor * @brief default constructor
*/ */
List() { obj_ = std::make_shared<ListObject>(); } List() { obj_ = std::make_shared<ListObject>(); }
/*! /*!
* \brief move constructor * @brief move constructor
* \param other source * @param other source
*/ */
List(List<T>&& other) { // NOLINT(*) List(List<T>&& other) { // NOLINT(*)
obj_ = std::move(other.obj_); obj_ = std::move(other.obj_);
} }
/*! /*!
* \brief copy constructor * @brief copy constructor
* \param other source * @param other source
*/ */
List(const List<T>& other) : ObjectRef(other.obj_) { // NOLINT(*) List(const List<T>& other) : ObjectRef(other.obj_) { // NOLINT(*)
} }
/*! /*!
* \brief constructor from pointer * @brief constructor from pointer
* \param n the container pointer * @param n the container pointer
*/ */
explicit List(std::shared_ptr<Object> n) : ObjectRef(n) {} explicit List(std::shared_ptr<Object> n) : ObjectRef(n) {}
/*! /*!
* \brief constructor from iterator * @brief constructor from iterator
* \param begin begin of iterator * @param begin begin of iterator
* \param end end of iterator * @param end end of iterator
* \tparam IterType The type of iterator * @tparam IterType The type of iterator
*/ */
template <typename IterType> template <typename IterType>
List(IterType begin, IterType end) { List(IterType begin, IterType end) {
assign(begin, end); assign(begin, end);
} }
/*! /*!
* \brief constructor from initializer list * @brief constructor from initializer list
* \param init The initalizer list * @param init The initalizer list
*/ */
List(std::initializer_list<T> init) { // NOLINT(*) List(std::initializer_list<T> init) { // NOLINT(*)
assign(init.begin(), init.end()); assign(init.begin(), init.end());
} }
/*! /*!
* \brief constructor from vector * @brief constructor from vector
* \param init The vector * @param init The vector
*/ */
List(const std::vector<T>& init) { // NOLINT(*) List(const std::vector<T>& init) { // NOLINT(*)
assign(init.begin(), init.end()); assign(init.begin(), init.end());
} }
/*! /*!
* \brief Constructs a container with n elements. Each element is a copy of * @brief Constructs a container with n elements. Each element is a copy of
* val \param n The size of the container \param val The init value * val \param n The size of the container \param val The init value
*/ */
explicit List(size_t n, const T& val) { explicit List(size_t n, const T& val) {
...@@ -245,28 +245,28 @@ class List : public ObjectRef { ...@@ -245,28 +245,28 @@ class List : public ObjectRef {
obj_ = std::move(tmp_obj); obj_ = std::move(tmp_obj);
} }
/*! /*!
* \brief move assign operator * @brief move assign operator
* \param other The source of assignment * @param other The source of assignment
* \return reference to self. * @return reference to self.
*/ */
List<T>& operator=(List<T>&& other) { List<T>& operator=(List<T>&& other) {
obj_ = std::move(other.obj_); obj_ = std::move(other.obj_);
return *this; return *this;
} }
/*! /*!
* \brief copy assign operator * @brief copy assign operator
* \param other The source of assignment * @param other The source of assignment
* \return reference to self. * @return reference to self.
*/ */
List<T>& operator=(const List<T>& other) { List<T>& operator=(const List<T>& other) {
obj_ = other.obj_; obj_ = other.obj_;
return *this; return *this;
} }
/*! /*!
* \brief reset the list to content from iterator. * @brief reset the list to content from iterator.
* \param begin begin of iterator * @param begin begin of iterator
* \param end end of iterator * @param end end of iterator
* \tparam IterType The type of iterator * @tparam IterType The type of iterator
*/ */
template <typename IterType> template <typename IterType>
void assign(IterType begin, IterType end) { void assign(IterType begin, IterType end) {
...@@ -277,9 +277,9 @@ class List : public ObjectRef { ...@@ -277,9 +277,9 @@ class List : public ObjectRef {
obj_ = std::move(n); obj_ = std::move(n);
} }
/*! /*!
* \brief Read i-th element from list. * @brief Read i-th element from list.
* \param i The index * @param i The index
* \return the i-th element. * @return the i-th element.
*/ */
inline const T operator[](size_t i) const { inline const T operator[](size_t i) const {
return T(static_cast<const ListObject*>(obj_.get())->data[i]); return T(static_cast<const ListObject*>(obj_.get())->data[i]);
...@@ -290,12 +290,12 @@ class List : public ObjectRef { ...@@ -290,12 +290,12 @@ class List : public ObjectRef {
return static_cast<const ListObject*>(obj_.get())->data.size(); return static_cast<const ListObject*>(obj_.get())->data.size();
} }
/*! /*!
* \brief copy on write semantics * @brief copy on write semantics
* Do nothing if current handle is the unique copy of the list. * Do nothing if current handle is the unique copy of the list.
* Otherwise make a new copy of the list to ensure the current handle * Otherwise make a new copy of the list to ensure the current handle
* hold a unique copy. * hold a unique copy.
* *
* \return Handle to the internal obj container(which ganrantees to be unique) * @return Handle to the internal obj container(which ganrantees to be unique)
*/ */
inline ListObject* CopyOnWrite() { inline ListObject* CopyOnWrite() {
if (obj_.get() == nullptr || !obj_.unique()) { if (obj_.get() == nullptr || !obj_.unique()) {
...@@ -305,17 +305,17 @@ class List : public ObjectRef { ...@@ -305,17 +305,17 @@ class List : public ObjectRef {
return static_cast<ListObject*>(obj_.get()); return static_cast<ListObject*>(obj_.get());
} }
/*! /*!
* \brief push a new item to the back of the list * @brief push a new item to the back of the list
* \param item The item to be pushed. * @param item The item to be pushed.
*/ */
inline void push_back(const T& item) { inline void push_back(const T& item) {
ListObject* n = this->CopyOnWrite(); ListObject* n = this->CopyOnWrite();
n->data.push_back(item.obj_); n->data.push_back(item.obj_);
} }
/*! /*!
* \brief set i-th element of the list. * @brief set i-th element of the list.
* \param i The index * @param i The index
* \param value The value to be setted. * @param value The value to be setted.
*/ */
inline void Set(size_t i, const T& value) { inline void Set(size_t i, const T& value) {
ListObject* n = this->CopyOnWrite(); ListObject* n = this->CopyOnWrite();
...@@ -323,11 +323,11 @@ class List : public ObjectRef { ...@@ -323,11 +323,11 @@ class List : public ObjectRef {
} }
/*! \return whether list is empty */ /*! \return whether list is empty */
inline bool empty() const { return size() == 0; } inline bool empty() const { return size() == 0; }
/*! \brief Copy the content to a vector */ /*! @brief Copy the content to a vector */
inline std::vector<T> ToVector() const { inline std::vector<T> ToVector() const {
return std::vector<T>(begin(), end()); return std::vector<T>(begin(), end());
} }
/*! \brief specify container obj */ /*! @brief specify container obj */
using ContainerType = ListObject; using ContainerType = ListObject;
struct Ptr2ObjectRef { struct Ptr2ObjectRef {
...@@ -362,7 +362,7 @@ class List : public ObjectRef { ...@@ -362,7 +362,7 @@ class List : public ObjectRef {
}; };
/*! /*!
* \brief Map container of ObjectRef->ObjectRef. * @brief Map container of ObjectRef->ObjectRef.
* *
* Map implements copy on write semantics, which means map is mutable * Map implements copy on write semantics, which means map is mutable
* but copy will happen when list is referenced in more than two places. * but copy will happen when list is referenced in more than two places.
...@@ -373,10 +373,10 @@ class List : public ObjectRef { ...@@ -373,10 +373,10 @@ class List : public ObjectRef {
* *
* operator[] only provide const acces, use Set to mutate the content. * operator[] only provide const acces, use Set to mutate the content.
* *
* \tparam K The key ObjectRef type. * @tparam K The key ObjectRef type.
* \tparam V The value ObjectRef type. * @tparam V The value ObjectRef type.
* *
* \note The element type must subclass \c ObjectRef. Otherwise, the * @note The element type must subclass \c ObjectRef. Otherwise, the
* compiler would throw an error: * compiler would throw an error:
* *
* <code> * <code>
...@@ -404,75 +404,75 @@ template < ...@@ -404,75 +404,75 @@ template <
class Map : public ObjectRef { class Map : public ObjectRef {
public: public:
/*! /*!
* \brief default constructor * @brief default constructor
*/ */
Map() { obj_ = std::make_shared<MapObject>(); } Map() { obj_ = std::make_shared<MapObject>(); }
/*! /*!
* \brief move constructor * @brief move constructor
* \param other source * @param other source
*/ */
Map(Map<K, V>&& other) { // NOLINT(*) Map(Map<K, V>&& other) { // NOLINT(*)
obj_ = std::move(other.obj_); obj_ = std::move(other.obj_);
} }
/*! /*!
* \brief copy constructor * @brief copy constructor
* \param other source * @param other source
*/ */
Map(const Map<K, V>& other) : ObjectRef(other.obj_) { // NOLINT(*) Map(const Map<K, V>& other) : ObjectRef(other.obj_) { // NOLINT(*)
} }
/*! /*!
* \brief constructor from pointer * @brief constructor from pointer
* \param n the container pointer * @param n the container pointer
*/ */
explicit Map(std::shared_ptr<Object> n) : ObjectRef(n) {} explicit Map(std::shared_ptr<Object> n) : ObjectRef(n) {}
/*! /*!
* \brief constructor from iterator * @brief constructor from iterator
* \param begin begin of iterator * @param begin begin of iterator
* \param end end of iterator * @param end end of iterator
* \tparam IterType The type of iterator * @tparam IterType The type of iterator
*/ */
template <typename IterType> template <typename IterType>
Map(IterType begin, IterType end) { Map(IterType begin, IterType end) {
assign(begin, end); assign(begin, end);
} }
/*! /*!
* \brief constructor from initializer list * @brief constructor from initializer list
* \param init The initalizer list * @param init The initalizer list
*/ */
Map(std::initializer_list<std::pair<K, V> > init) { // NOLINT(*) Map(std::initializer_list<std::pair<K, V> > init) { // NOLINT(*)
assign(init.begin(), init.end()); assign(init.begin(), init.end());
} }
/*! /*!
* \brief constructor from vector * @brief constructor from vector
* \param init The vector * @param init The vector
*/ */
template <typename Hash, typename Equal> template <typename Hash, typename Equal>
Map(const std::unordered_map<K, V, Hash, Equal>& init) { // NOLINT(*) Map(const std::unordered_map<K, V, Hash, Equal>& init) { // NOLINT(*)
assign(init.begin(), init.end()); assign(init.begin(), init.end());
} }
/*! /*!
* \brief move assign operator * @brief move assign operator
* \param other The source of assignment * @param other The source of assignment
* \return reference to self. * @return reference to self.
*/ */
Map<K, V>& operator=(Map<K, V>&& other) { Map<K, V>& operator=(Map<K, V>&& other) {
obj_ = std::move(other.obj_); obj_ = std::move(other.obj_);
return *this; return *this;
} }
/*! /*!
* \brief copy assign operator * @brief copy assign operator
* \param other The source of assignment * @param other The source of assignment
* \return reference to self. * @return reference to self.
*/ */
Map<K, V>& operator=(const Map<K, V>& other) { Map<K, V>& operator=(const Map<K, V>& other) {
obj_ = other.obj_; obj_ = other.obj_;
return *this; return *this;
} }
/*! /*!
* \brief reset the list to content from iterator. * @brief reset the list to content from iterator.
* \param begin begin of iterator * @param begin begin of iterator
* \param end end of iterator * @param end end of iterator
* \tparam IterType The type of iterator * @tparam IterType The type of iterator
*/ */
template <typename IterType> template <typename IterType>
void assign(IterType begin, IterType end) { void assign(IterType begin, IterType end) {
...@@ -483,17 +483,17 @@ class Map : public ObjectRef { ...@@ -483,17 +483,17 @@ class Map : public ObjectRef {
obj_ = std::move(n); obj_ = std::move(n);
} }
/*! /*!
* \brief Read element from map. * @brief Read element from map.
* \param key The key * @param key The key
* \return the corresonding element. * @return the corresonding element.
*/ */
inline const V operator[](const K& key) const { inline const V operator[](const K& key) const {
return V(static_cast<const MapObject*>(obj_.get())->data.at(key.obj_)); return V(static_cast<const MapObject*>(obj_.get())->data.at(key.obj_));
} }
/*! /*!
* \brief Read element from map. * @brief Read element from map.
* \param key The key * @param key The key
* \return the corresonding element. * @return the corresonding element.
*/ */
inline const V at(const K& key) const { inline const V at(const K& key) const {
return V(static_cast<const MapObject*>(obj_.get())->data.at(key.obj_)); return V(static_cast<const MapObject*>(obj_.get())->data.at(key.obj_));
...@@ -509,12 +509,12 @@ class Map : public ObjectRef { ...@@ -509,12 +509,12 @@ class Map : public ObjectRef {
return static_cast<const MapObject*>(obj_.get())->data.count(key.obj_); return static_cast<const MapObject*>(obj_.get())->data.count(key.obj_);
} }
/*! /*!
* \brief copy on write semantics * @brief copy on write semantics
* Do nothing if current handle is the unique copy of the list. * Do nothing if current handle is the unique copy of the list.
* Otherwise make a new copy of the list to ensure the current handle * Otherwise make a new copy of the list to ensure the current handle
* hold a unique copy. * hold a unique copy.
* *
* \return Handle to the internal obj container(which ganrantees to be unique) * @return Handle to the internal obj container(which ganrantees to be unique)
*/ */
inline MapObject* CopyOnWrite() { inline MapObject* CopyOnWrite() {
if (obj_.get() == nullptr || !obj_.unique()) { if (obj_.get() == nullptr || !obj_.unique()) {
...@@ -524,9 +524,9 @@ class Map : public ObjectRef { ...@@ -524,9 +524,9 @@ class Map : public ObjectRef {
return static_cast<MapObject*>(obj_.get()); return static_cast<MapObject*>(obj_.get());
} }
/*! /*!
* \brief set the Map. * @brief set the Map.
* \param key The index key. * @param key The index key.
* \param value The value to be setted. * @param value The value to be setted.
*/ */
inline void Set(const K& key, const V& value) { inline void Set(const K& key, const V& value) {
MapObject* n = this->CopyOnWrite(); MapObject* n = this->CopyOnWrite();
...@@ -535,7 +535,7 @@ class Map : public ObjectRef { ...@@ -535,7 +535,7 @@ class Map : public ObjectRef {
/*! \return whether list is empty */ /*! \return whether list is empty */
inline bool empty() const { return size() == 0; } inline bool empty() const { return size() == 0; }
/*! \brief specify container obj */ /*! @brief specify container obj */
using ContainerType = MapObject; using ContainerType = MapObject;
struct Ptr2ObjectRef { struct Ptr2ObjectRef {
...@@ -660,10 +660,10 @@ class Map<std::string, V, T1, T2> : public ObjectRef { ...@@ -660,10 +660,10 @@ class Map<std::string, V, T1, T2> : public ObjectRef {
}; };
/*! /*!
* \brief Helper function to convert a List<Value> object to a vector. * @brief Helper function to convert a List<Value> object to a vector.
* \tparam T element type * @tparam T element type
* \param list Input list object. * @param list Input list object.
* \return std vector * @return std vector
*/ */
template <typename T> template <typename T>
inline std::vector<T> ListValueToVector(const List<Value>& list) { inline std::vector<T> ListValueToVector(const List<Value>& list) {
......
This diff is collapsed.
/*! /*!
* Copyright (c) 2022 by Contributors * Copyright (c) 2022 by Contributors
* \file include/dgl/runtime/dlpack_convert.h * @file include/dgl/runtime/dlpack_convert.h
* \brief Conversion between NDArray and DLPack. * @brief Conversion between NDArray and DLPack.
*/ */
#ifndef DGL_RUNTIME_DLPACK_CONVERT_H_ #ifndef DGL_RUNTIME_DLPACK_CONVERT_H_
#define DGL_RUNTIME_DLPACK_CONVERT_H_ #define DGL_RUNTIME_DLPACK_CONVERT_H_
...@@ -16,20 +16,20 @@ namespace runtime { ...@@ -16,20 +16,20 @@ namespace runtime {
struct DLPackConvert { struct DLPackConvert {
/*! /*!
* \brief Create a DGL NDArray from a DLPack tensor. * @brief Create a DGL NDArray from a DLPack tensor.
* *
* This allows us to create a NDArray using the memory * This allows us to create a NDArray using the memory
* allocated by an external deep learning framework * allocated by an external deep learning framework
* that is DLPack compatible. * that is DLPack compatible.
* *
* The memory is retained until the NDArray went out of scope. * The memory is retained until the NDArray went out of scope.
* \param tensor The DLPack tensor to copy from. * @param tensor The DLPack tensor to copy from.
* \return The created NDArray view. * @return The created NDArray view.
*/ */
static NDArray FromDLPack(DLManagedTensor* tensor); static NDArray FromDLPack(DLManagedTensor* tensor);
/*! /*!
* \brief Deleter for NDArray converted from DLPack. * @brief Deleter for NDArray converted from DLPack.
* *
* This is used from data which is passed from external * This is used from data which is passed from external
* DLPack(DLManagedTensor) that are not allocated inside of DGL. This enables * DLPack(DLManagedTensor) that are not allocated inside of DGL. This enables
...@@ -38,10 +38,10 @@ struct DLPackConvert { ...@@ -38,10 +38,10 @@ struct DLPackConvert {
*/ */
static void DLPackDeleter(NDArray::Container* ptr); static void DLPackDeleter(NDArray::Container* ptr);
/*! \brief Convert a DGL NDArray to a DLPack tensor. /*! @brief Convert a DGL NDArray to a DLPack tensor.
* *
* \param from The DGL NDArray. * @param from The DGL NDArray.
* \return A DLPack tensor. * @return A DLPack tensor.
*/ */
static DLManagedTensor* ToDLPack(const NDArray& from); static DLManagedTensor* ToDLPack(const NDArray& from);
}; };
...@@ -54,26 +54,26 @@ extern "C" { ...@@ -54,26 +54,26 @@ extern "C" {
#endif #endif
/*! /*!
* \brief Delete (free) a DLManagedTensor's data. * @brief Delete (free) a DLManagedTensor's data.
* \param dltensor Pointer to the DLManagedTensor. * @param dltensor Pointer to the DLManagedTensor.
*/ */
DGL_DLL void DGLDLManagedTensorCallDeleter(DLManagedTensor* dltensor); DGL_DLL void DGLDLManagedTensorCallDeleter(DLManagedTensor* dltensor);
/*! /*!
* \brief Produce an array from the DLManagedTensor that shares data memory * @brief Produce an array from the DLManagedTensor that shares data memory
* with the DLManagedTensor. * with the DLManagedTensor.
* \param from The source DLManagedTensor. * @param from The source DLManagedTensor.
* \param out The output array handle. * @param out The output array handle.
* \return 0 when success, -1 when failure happens * @return 0 when success, -1 when failure happens
*/ */
DGL_DLL int DGLArrayFromDLPack(DLManagedTensor* from, DGLArrayHandle* out); DGL_DLL int DGLArrayFromDLPack(DLManagedTensor* from, DGLArrayHandle* out);
/*! /*!
* \brief Produce a DLMangedTensor from the array that shares data memory with * @brief Produce a DLMangedTensor from the array that shares data memory with
* the array. * the array.
* \param from The source array. * @param from The source array.
* \param out The DLManagedTensor handle. * @param out The DLManagedTensor handle.
* \return 0 when success, -1 when failure happens * @return 0 when success, -1 when failure happens
*/ */
DGL_DLL int DGLArrayToDLPack( DGL_DLL int DGLArrayToDLPack(
DGLArrayHandle from, DLManagedTensor** out, int alignment = 0); DGLArrayHandle from, DLManagedTensor** out, int alignment = 0);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*! /*!
* Copyright (c) 2017 by Contributors * Copyright (c) 2017 by Contributors
* \file dgl/runtime/serializer.h * @file dgl/runtime/serializer.h
* \brief Serializer extension to support DGL data types * @brief Serializer extension to support DGL data types
* Include this file to enable serialization of DGLDataType, DGLContext * Include this file to enable serialization of DGLDataType, DGLContext
*/ */
#ifndef DGL_RUNTIME_SERIALIZER_H_ #ifndef DGL_RUNTIME_SERIALIZER_H_
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment