提交 6edf0e65 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!1434 Fix log and comment errors in graphdata

Merge pull request !1434 from heleiwang/fix_redundant_log
#!/bin/bash
rm /tmp/citeseer/mindrecord/*
SRC_PATH=/tmp/citeseer/dataset
MINDRECORD_PATH=/tmp/citeseer/mindrecord
rm -f $MINDRECORD_PATH/*
python writer.py --mindrecord_script citeseer \
--mindrecord_file "/tmp/citeseer/mindrecord/citeseer_mr" \
--mindrecord_file "$MINDRECORD_PATH/citeseer_mr" \
--mindrecord_partitions 1 \
--mindrecord_header_size_by_bit 18 \
--mindrecord_page_size_by_bit 20 \
--graph_api_args "/tmp/citeseer/dataset/citeseer.content:/tmp/citeseer/dataset/citeseer.cites"
--graph_api_args "$SRC_PATH/citeseer.content:$SRC_PATH/citeseer.cites"
#!/bin/bash
rm /tmp/cora/mindrecord/*
SRC_PATH=/tmp/cora/dataset
MINDRECORD_PATH=/tmp/cora/mindrecord
rm -f $MINDRECORD_PATH/*
python writer.py --mindrecord_script cora \
--mindrecord_file "/tmp/cora/mindrecord/cora_mr" \
--mindrecord_file "$MINDRECORD_PATH/cora_mr" \
--mindrecord_partitions 1 \
--mindrecord_header_size_by_bit 18 \
--mindrecord_page_size_by_bit 20 \
--graph_api_args "/tmp/cora/dataset/cora_content.csv:/tmp/cora/dataset/cora_cites.csv"
--graph_api_args "$SRC_PATH/cora_content.csv:$SRC_PATH/cora_cites.csv"
......@@ -51,7 +51,7 @@ Status Graph::CreateTensorByVector(const std::vector<std::vector<T>> &data, Data
RETURN_STATUS_UNEXPECTED("Data type not compatible");
}
if (data.empty()) {
RETURN_STATUS_UNEXPECTED("Input data is emply");
RETURN_STATUS_UNEXPECTED("Input data is empty");
}
std::shared_ptr<Tensor> tensor;
size_t m = data.size();
......@@ -74,7 +74,7 @@ Status Graph::CreateTensorByVector(const std::vector<std::vector<T>> &data, Data
template <typename T>
Status Graph::ComplementVector(std::vector<std::vector<T>> *data, size_t max_size, T default_value) {
if (!data || data->empty()) {
RETURN_STATUS_UNEXPECTED("Input data is emply");
RETURN_STATUS_UNEXPECTED("Input data is empty");
}
for (std::vector<T> &vec : *data) {
size_t size = vec.size();
......@@ -93,6 +93,9 @@ Status Graph::GetEdges(EdgeType edge_type, EdgeIdType edge_num, std::shared_ptr<
Status Graph::GetAllNeighbors(const std::vector<NodeIdType> &node_list, NodeType neighbor_type,
std::shared_ptr<Tensor> *out) {
if (node_list.empty()) {
RETURN_STATUS_UNEXPECTED("Input node_list is empty.");
}
if (node_type_map_.find(neighbor_type) == node_type_map_.end()) {
std::string err_msg = "Invalid neighbor type:" + std::to_string(neighbor_type);
RETURN_STATUS_UNEXPECTED(err_msg);
......@@ -147,7 +150,7 @@ Status Graph::GetNodeDefaultFeature(FeatureType feature_type, std::shared_ptr<Fe
Status Graph::GetNodeFeature(const std::shared_ptr<Tensor> &nodes, const std::vector<FeatureType> &feature_types,
TensorRow *out) {
if (!nodes || nodes->Size() == 0) {
RETURN_STATUS_UNEXPECTED("Inpude nodes is empty");
RETURN_STATUS_UNEXPECTED("Input nodes is empty");
}
TensorRow tensors;
for (auto f_type : feature_types) {
......
......@@ -156,7 +156,7 @@ class Graph {
std::unordered_map<EdgeIdType, std::shared_ptr<Edge>> edge_id_map_;
std::unordered_map<NodeType, std::unordered_set<FeatureType>> node_feature_map_;
std::unordered_map<NodeType, std::unordered_set<FeatureType>> edge_feature_map_;
std::unordered_map<EdgeType, std::unordered_set<FeatureType>> edge_feature_map_;
std::unordered_map<FeatureType, std::shared_ptr<Feature>> default_feature_map_;
};
......
......@@ -78,7 +78,7 @@ class GraphData:
>>> import mindspore.dataset as ds
>>> data_graph = ds.GraphData('dataset_file', 2)
>>> nodes = data_graph.get_all_nodes(0)
>>> neighbors = data_graph.get_all_neighbors(nodes[0], 0)
>>> neighbors = data_graph.get_all_neighbors(nodes, 0)
Raises:
TypeError: If `node_list` is not list or ndarray.
......@@ -102,7 +102,7 @@ class GraphData:
>>> import mindspore.dataset as ds
>>> data_graph = ds.GraphData('dataset_file', 2)
>>> nodes = data_graph.get_all_nodes(0)
>>> features = data_graph.get_node_feature(nodes[0], [1])
>>> features = data_graph.get_node_feature(nodes, [1])
Raises:
TypeError: If `node_list` is not list or ndarray.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册