Random_walk_with_restart cannot use with HeteroGraph?

hello, Newbie of DGL here. when i wangt to rely on the dgl.contrib.sampling.random_walk_with_restart
i got the error:
Traceback (most recent call last):

  • File “E:/BYOL/DataPro/001.py”, line 42, in *
  • traces = dgl.contrib.sampling.random_walk_with_restart(g1, graph_idx, restart_prob=0.8, max_nodes_per_seed=20)*
  • File “D:\Program Files\Anaconda\envs\xixi\lib\site-packages\dgl\contrib\sampling\randomwalk.py”, line 128, in random_walk_with_restart*
  • int(max_visit_counts), int(max_frequent_visited_nodes))*
  • File “D:\Program Files\Anaconda\envs\xixi\lib\site-packages\dgl_ffi_ctypes\function.py”, line 190, in call*
  • ctypes.byref(ret_val), ctypes.byref(ret_tcode)))*
  • File “D:\Program Files\Anaconda\envs\xixi\lib\site-packages\dgl_ffi\base.py”, line 62, in check_call*
  • raise DGLError(py_str(_LIB.DGLGetLastError()))*
    dgl._ffi.base.DGLError: [19:28:39] C:\Users\Administrator\dgl-0.5\include\dgl/packed_func_ext.h:117: Check failed: ObjectTypeChecker::Check(sptr.get()): Expected type graph.Graph but get graph.HeteroGraph

Process finished with exit code 1

Maybe random_walk_with_restart can not use with graph.HeteroGraph. Do you have some recommendations for my case?
Thanks in advance!

Can you try this API instead?

I didn’t notice this API before. I successfully solved my problem.
Thank you very much!