提交 867dbd26 编写于 作者: Z Zhong Hui

fix typo

上级 1bdf429c
......@@ -11,12 +11,16 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""graph saint sample test"""
"""graph saint sample test
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import numpy as np
import pgl
import numpy as np
import paddle.fluid as fluid
from pgl.sample import graph_saint_random_walk_sample
......@@ -25,14 +29,14 @@ class GraphSaintSampleTest(unittest.TestCase):
"""GraphSaintSampleTest"""
def test_randomwalk_sampler(self):
"""test_scatter_add"""
"""test_randomwalk_sampler"""
g = pgl.graph.Graph(
num_nodes=8,
edges=[(1, 2), (2, 3), (0, 2), (0, 1), (6, 7), (4, 5), (6, 4),
(7, 4), (3, 4)])
subgraph = graph_saint_random_walk_sample(g, [6, 7], 2)
print('reinded', subgraph._from_reindex)
print('sub_edges', subgraph.edges)
print('reindex', subgraph._from_reindex)
print('subedges', subgraph.edges)
assert len(subgraph.nodes) == 4
assert len(subgraph.edges) == 4
true_edges = np.array([[0, 1], [2, 3], [2, 0], [3, 0]])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册