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

[Misc] Replace /*! with /**. (#4823)



* replace

* blabla

* balbla

* blabla
Co-authored-by: default avatarSteve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
parent 619d735d
/*!
/**
* Copyright (c) 2018 by Contributors
* @file graph/graph.cc
* @brief Graph operation implementation
......
/*!
/**
* Copyright (c) 2018 by Contributors
* @file graph/traversal.cc
* @brief Graph traversal implementation
......
/*!
/**
* Copyright (c) 2019 by Contributors
* @file graph/heterograph.cc
* @brief Heterograph implementation
......
/*!
/**
* Copyright (c) 2019 by Contributors
* @file graph/heterograph.h
* @brief Heterograph
......@@ -21,7 +21,7 @@
namespace dgl {
/*! @brief Heterograph */
/** @brief Heterograph */
class HeteroGraph : public BaseHeteroGraph {
public:
HeteroGraph(
......@@ -219,20 +219,20 @@ class HeteroGraph : public BaseHeteroGraph {
GraphPtr AsImmutableGraph() const override;
/*! @return Load HeteroGraph from stream, using CSRMatrix*/
/** @return Load HeteroGraph from stream, using CSRMatrix*/
bool Load(dmlc::Stream* fs);
/*! @return Save HeteroGraph to stream, using CSRMatrix */
/** @return Save HeteroGraph to stream, using CSRMatrix */
void Save(dmlc::Stream* fs) const;
/*! @brief Convert the graph to use the given number of bits for storage */
/** @brief Convert the graph to use the given number of bits for storage */
static HeteroGraphPtr AsNumBits(HeteroGraphPtr g, uint8_t bits);
/*! @brief Copy the data to another context */
/** @brief Copy the data to another context */
static HeteroGraphPtr CopyTo(HeteroGraphPtr g, const DGLContext &ctx);
/*!
/**
* @brief Pin all relation graphs of the current graph.
* @note The graph will be pinned inplace. Behavior depends on the current context,
* kDGLCPU: will be pinned;
......@@ -242,7 +242,7 @@ class HeteroGraph : public BaseHeteroGraph {
*/
void PinMemory_() override;
/*!
/**
* @brief Unpin all relation graphs of the current graph.
* @note The graph will be unpinned inplace. Behavior depends on the current context,
* IsPinned: will be unpinned;
......@@ -251,13 +251,13 @@ class HeteroGraph : public BaseHeteroGraph {
*/
void UnpinMemory_();
/*!
/**
* @brief Record stream for this graph.
* @param stream The stream that is using the graph
*/
void RecordStream(DGLStreamHandle stream) override;
/*! @brief Copy the data to shared memory.
/** @brief Copy the data to shared memory.
*
* Also save names of node types and edge types of the HeteroGraph object to shared memory
*/
......@@ -265,13 +265,13 @@ class HeteroGraph : public BaseHeteroGraph {
HeteroGraphPtr g, const std::string& name, const std::vector<std::string>& ntypes,
const std::vector<std::string>& etypes, const std::set<std::string>& fmts);
/*! @brief Create a heterograph from
/** @brief Create a heterograph from
* \return the HeteroGraphPtr, names of node types, names of edge types
*/
static std::tuple<HeteroGraphPtr, std::vector<std::string>, std::vector<std::string>>
CreateFromSharedMem(const std::string &name);
/*! @brief Creat a LineGraph of self */
/** @brief Creat a LineGraph of self */
HeteroGraphPtr LineGraph(bool backtracking) const;
const std::vector<UnitGraphPtr>& relation_graphs() const {
......@@ -285,19 +285,19 @@ class HeteroGraph : public BaseHeteroGraph {
// Empty Constructor, only for serializer
HeteroGraph() : BaseHeteroGraph() {}
/*! @brief A map from edge type to unit graph */
/** @brief A map from edge type to unit graph */
std::vector<UnitGraphPtr> relation_graphs_;
/*! @brief A map from vert type to the number of verts in the type */
/** @brief A map from vert type to the number of verts in the type */
std::vector<int64_t> num_verts_per_type_;
/*! @brief The shared memory object for meta info*/
/** @brief The shared memory object for meta info*/
std::shared_ptr<runtime::SharedMemory> shared_mem_;
/*! @brief The name of the shared memory. Return empty string if it is not in shared memory. */
/** @brief The name of the shared memory. Return empty string if it is not in shared memory. */
std::string SharedMemName() const;
/*! @brief template class for Flatten operation
/** @brief template class for Flatten operation
*
* @tparam IdType Graph's index data type, can be int32_t or int64_t
* @param etypes vector of etypes to be falttened
......
/*!
/**
* Copyright (c) 2020 by Contributors
* @file graph/heterograph_capi.cc
* @brief Heterograph CAPI bindings.
......
/*!
/**
* Copyright (c) 2018 by Contributors
* @file graph/immutable_graph.cc
* @brief DGL immutable graph index implementation
......@@ -29,7 +29,7 @@ inline std::string GetSharedMemName(
return name + "_" + edge_dir;
}
/*
/**
* The metadata of a graph index that are needed for shared-memory graph.
*/
struct GraphIndexMetadata {
......@@ -40,7 +40,7 @@ struct GraphIndexMetadata {
bool has_coo;
};
/*
/**
* Serialize the metadata of a graph index and place it in a shared-memory
* tensor. In this way, another process can reconstruct a GraphIndex from a
* shared-memory tensor.
......@@ -65,7 +65,7 @@ NDArray SerializeMetadata(ImmutableGraphPtr gidx, const std::string &name) {
#endif // _WIN32
}
/*
/**
* Deserialize the metadata of a graph index.
*/
GraphIndexMetadata DeserializeMetadata(const std::string &name) {
......@@ -430,7 +430,7 @@ CSRPtr ImmutableGraph::GetInCSR() const {
return in_csr_;
}
/* !\brief Return out csr. If not exist, transpose the other one.*/
/** @brief Return out csr. If not exist, transpose the other one.*/
CSRPtr ImmutableGraph::GetOutCSR() const {
if (!out_csr_) {
if (in_csr_) {
......@@ -447,7 +447,7 @@ CSRPtr ImmutableGraph::GetOutCSR() const {
return out_csr_;
}
/* !\brief Return coo. If not exist, create from csr.*/
/** @brief Return coo. If not exist, create from csr.*/
COOPtr ImmutableGraph::GetCOO() const {
if (!coo_) {
if (in_csr_) {
......@@ -626,7 +626,7 @@ ImmutableGraphPtr ImmutableGraph::Reverse() const {
constexpr uint64_t kDGLSerialize_ImGraph = 0xDD3c5FFE20046ABF;
/*! @return Load HeteroGraph from stream, using OutCSR Matrix*/
/** @return Load HeteroGraph from stream, using OutCSR Matrix*/
bool ImmutableGraph::Load(dmlc::Stream *fs) {
uint64_t magicNum;
aten::CSRMatrix out_csr_matrix;
......@@ -637,7 +637,7 @@ bool ImmutableGraph::Load(dmlc::Stream *fs) {
return true;
}
/*! @return Save HeteroGraph to stream, using OutCSR Matrix */
/** @return Save HeteroGraph to stream, using OutCSR Matrix */
void ImmutableGraph::Save(dmlc::Stream *fs) const {
fs->Write(kDGLSerialize_ImGraph);
fs->Write(GetOutCSR());
......
/*!
/**
* Copyright (c) 2020 by Contributors
* @file graph/metis_partition.cc
* @brief Call Metis partitioning
......
/*!
/**
* Copyright (c) 2018-2022 by Contributors
* @file graph/network.cc
* @brief DGL networking related APIs
......
/*!
/**
* Copyright (c) 2018 by Contributors
* @file graph/network.h
* @brief DGL networking related APIs
......@@ -21,70 +21,70 @@ using dgl::runtime::NDArray;
namespace dgl {
namespace network {
/*!
/**
* @brief Create NDArray from raw data
*/
NDArray CreateNDArrayFromRaw(
std::vector<int64_t> shape, DGLDataType dtype, DGLContext ctx, void* raw);
/*!
/**
* @brief Message type for DGL distributed training
*/
enum MessageType {
/*!
/**
* @brief Message for send/recv NodeFlow
*/
kNodeFlowMsg = 0,
/*!
/**
* @brief Message for end-signal
*/
kFinalMsg = 1,
/*!
/**
* @brief Initialize KVStore
*/
kInitMsg = 2,
/*!
/**
* @brief Push msg to KVStore
*/
kPushMsg = 3,
/*!
/**
* @brief Pull msg from KVStore
*/
kPullMsg = 4,
/*!
/**
* @brief PullBack msg from KVStore
*/
kPullBackMsg = 5,
/*!
/**
* @brief Barrier msg for KVStore
*/
kBarrierMsg = 6,
/*!
/**
* @brief IP and ID msg for KVStore
*/
kIPIDMsg = 7,
/*!
/**
* @brief Get data shape msg for KVStore
*/
kGetShapeMsg = 8,
/*!
/**
* @brief Get data shape back msg for KVStore
*/
kGetShapeBackMsg = 9
};
/*!
/**
* @brief Meta data for NDArray message
*/
class ArrayMeta {
public:
/*!
/**
* @brief ArrayMeta constructor.
* @param msg_type type of message
*/
explicit ArrayMeta(int msg_type) : msg_type_(msg_type), ndarray_count_(0) {}
/*!
/**
* @brief Construct ArrayMeta from binary data buffer.
* @param buffer data buffer
* @param size data size
......@@ -94,69 +94,69 @@ class ArrayMeta {
this->Deserialize(buffer, size);
}
/*!
/**
* @return message type
*/
inline int msg_type() const { return msg_type_; }
/*!
/**
* @return count of ndarray
*/
inline int ndarray_count() const { return ndarray_count_; }
/*!
/**
* @brief Add NDArray meta data to ArrayMeta
* @param array DGL NDArray
*/
void AddArray(const NDArray& array);
/*!
/**
* @brief Serialize ArrayMeta to data buffer
* @param size size of serialized message
* @return pointer of data buffer
*/
char* Serialize(int64_t* size);
/*!
/**
* @brief Deserialize ArrayMeta from data buffer
* @param buffer data buffer
* @param size size of data buffer
*/
void Deserialize(char* buffer, int64_t size);
/*!
/**
* @brief type of message
*/
int msg_type_;
/*!
/**
* @brief count of ndarray in MetaMsg
*/
int ndarray_count_;
/*!
/**
* @brief DataType for each NDArray
*/
std::vector<DGLDataType> data_type_;
/*!
/**
* @brief We first write the ndim to data_shape_
* and then write the data shape.
*/
std::vector<int64_t> data_shape_;
};
/*!
/**
* @brief C structure for holding DGL KVServer message
*/
class KVStoreMsg {
public:
/*!
/**
* @brief KVStoreMsg constructor.
*/
KVStoreMsg() {}
/*!
/**
* @brief Construct KVStoreMsg from binary data buffer.
* @param buffer data buffer
* @param size data size
......@@ -165,7 +165,7 @@ class KVStoreMsg {
CHECK_NOTNULL(buffer);
this->Deserialize(buffer, size);
}
/*!
/**
* @brief Serialize KVStoreMsg to data buffer
* Note that we don't serialize ID and data here.
* @param size size of serialized message
......@@ -173,34 +173,34 @@ class KVStoreMsg {
*/
char* Serialize(int64_t* size);
/*!
/**
* @brief Deserialize KVStoreMsg from data buffer
* @param buffer data buffer
* @param size size of data buffer
*/
void Deserialize(char* buffer, int64_t size);
/*!
/**
* @brief Message type of kvstore
*/
int msg_type;
/*!
/**
* @brief Sender's ID
*/
int rank;
/*!
/**
* @brief data name
*/
std::string name;
/*!
/**
* @brief data ID
*/
NDArray id;
/*!
/**
* @brief data matrix
*/
NDArray data;
/*!
/**
* @brief data shape
*/
NDArray shape;
......
/*!
/**
* Copyright (c) 2019 by Contributors
* @file graph/nodeflow.cc
* @brief DGL NodeFlow related functions.
......
/*!
/**
* Copyright (c) 2020 by Contributors
* @file graph/pickle.cc
* @brief Functions for pickle and unpickle a graph
......
/*!
/**
* Copyright (c) 2018 by Contributors
* @file graph/sampler.cc
* @brief DGL sampler implementation
......@@ -24,7 +24,7 @@ using namespace dgl::runtime;
namespace dgl {
namespace {
/*
/**
* ArrayHeap is used to sample elements from vector
*/
template <typename ValueType>
......@@ -49,7 +49,7 @@ class ArrayHeap {
}
~ArrayHeap() {}
/*
/**
* Remove term from index (this costs O(log m) steps)
*/
void Delete(size_t index) {
......@@ -64,7 +64,7 @@ class ArrayHeap {
}
}
/*
/**
* Add value w to index (this costs O(log m) steps)
*/
void Add(size_t index, ValueType w) {
......@@ -75,7 +75,7 @@ class ArrayHeap {
}
}
/*
/**
* Sample from arrayHeap
*/
size_t Sample() {
......@@ -92,7 +92,7 @@ class ArrayHeap {
return i - limit_;
}
/*
/**
* Sample a vector by given the size n
*/
size_t SampleWithoutReplacement(size_t n, std::vector<size_t> *samples) {
......@@ -175,7 +175,7 @@ class EdgeSamplerObject : public Object {
int64_t chunk_size_;
};
/*
/**
* Uniformly sample integers from [0, set_size) without replacement.
*/
void RandomSample(size_t set_size, size_t num, std::vector<size_t> *out) {
......@@ -221,7 +221,7 @@ void RandomSample(
}
}
/*
/**
* For a sparse array whose non-zeros are represented by nz_idxs,
* negate the sparse array and outputs the non-zeros in the negated array.
*/
......@@ -244,7 +244,7 @@ void NegateArray(
}
}
/*
/**
* Uniform sample vertices from a list of vertices.
*/
void GetUniformSample(
......@@ -281,7 +281,7 @@ void GetUniformSample(
}
}
/*
/**
* Non-uniform sample via ArrayHeap
*
* @param probability Transition probability on the entire graph, indexed by
......@@ -318,7 +318,7 @@ void GetNonUniformSample(
sort(out_edge->begin(), out_edge->end());
}
/*
/**
* Used for subgraph sampling
*/
struct neigh_list {
......@@ -643,7 +643,7 @@ void ConstructLayers(
const std::vector<dgl_id_t> &seed_array, IdArray layer_sizes,
std::vector<dgl_id_t> *layer_offsets, std::vector<dgl_id_t> *node_mapping,
std::vector<int64_t> *actl_layer_sizes, std::vector<float> *probabilities) {
/*
/**
* Given a graph and a collection of seed nodes, this function constructs
* NodeFlow layers via uniform layer-wise sampling, and return the resultant
* layers and their corresponding probabilities.
......@@ -705,7 +705,7 @@ void ConstructFlows(
std::vector<dgl_id_t> *sub_indptr, std::vector<dgl_id_t> *sub_indices,
std::vector<dgl_id_t> *sub_eids, std::vector<dgl_id_t> *flow_offsets,
std::vector<dgl_id_t> *edge_mapping) {
/*
/**
* Given a graph and a sequence of NodeFlow layers, this function constructs
* dense subgraphs (flows) between consecutive layers.
*/
......
/*!
/**
* Copyright (c) 2021 by Contributors
* @file graph/sampling/negative/global_uniform.cc
* @brief Global uniform negative sampling.
......
/*!
/**
* Copyright (c) 2020-2021 by Contributors
* @file graph/sampling/neighbor.cc
* @brief Definition of neighborhood-based sampler APIs.
......
/*!
/**
* Copyright (c) 2021 by Contributors
* @file graph/sampling/frequency_hashmap.cu
* @brief frequency hashmap - used to select top-k frequency edges of each node
......
/*!
/**
* Copyright (c) 2021 by Contributors
* @file graph/sampling/frequency_hashmap.cuh
* @brief frequency hashmap - used to select top-k frequency edges of each node
......
/*!
/**
* Copyright (c) 2018 by Contributors
* @file graph/sampling/get_node_types_cpu.cc
* @brief DGL sampler - CPU implementation of random walks with OpenMP
......
/*!
/**
* Copyright (c) 2021 by Contributors
* @file graph/sampling/get_node_types_gpu.cu
* @brief DGL sampler
......
/*!
/**
* Copyright (c) 2018 by Contributors
* @file graph/sampler/generic_randomwalk_cpu.h
* @brief DGL sampler - templated implementation definition of random walks on
......@@ -37,7 +37,7 @@ namespace {
template <typename IdxType>
using TerminatePredicate = std::function<bool(IdxType *, dgl_id_t, int64_t)>;
/*!
/**
* @brief Select one successor of metapath-based random walk, given the path
* generated so far.
*
......@@ -103,7 +103,7 @@ std::tuple<dgl_id_t, dgl_id_t, bool> MetapathRandomWalkStep(
return std::make_tuple(succ[idx], eid, terminate(data, curr, len));
}
/*!
/**
* @brief Select one successor of metapath-based random walk, given the path
* generated so far specifically for the uniform probability distribution.
*
......@@ -154,7 +154,7 @@ std::tuple<dgl_id_t, dgl_id_t, bool> MetapathRandomWalkStepUniform(
return std::make_tuple(succ[idx], eid, terminate(data, curr, len));
}
/*!
/**
* @brief Metapath-based random walk.
* @param hg The heterograph.
* @param seeds A 1D array of seed nodes, with the type the source type of the
......
/*!
/**
* Copyright (c) 2021 by Contributors
* @file graph/sampling/node2vec.cc
* @brief Dispatcher of DGL node2vec random walks
......
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