neighbor_sample_cpu.cpp 17.4 KB
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
#include "neighbor_sample_cpu.h"

#include "utils.h"

rusty1s's avatar
rusty1s committed
5
6
7
8
#ifdef _WIN32
#include <process.h>
#endif

rusty1s's avatar
rusty1s committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using namespace std;

namespace {

template <bool replace, bool directed>
tuple<torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor>
sample(const torch::Tensor &colptr, const torch::Tensor &row,
       const torch::Tensor &input_node, const vector<int64_t> num_neighbors) {

  // Initialize some data structures for the sampling process:
  vector<int64_t> samples;
  unordered_map<int64_t, int64_t> to_local_node;

  auto *colptr_data = colptr.data_ptr<int64_t>();
  auto *row_data = row.data_ptr<int64_t>();
  auto *input_node_data = input_node.data_ptr<int64_t>();

  for (int64_t i = 0; i < input_node.numel(); i++) {
    const auto &v = input_node_data[i];
    samples.push_back(v);
    to_local_node.insert({v, i});
  }

  vector<int64_t> rows, cols, edges;

  int64_t begin = 0, end = samples.size();
  for (int64_t ell = 0; ell < (int64_t)num_neighbors.size(); ell++) {
    const auto &num_samples = num_neighbors[ell];
    for (int64_t i = begin; i < end; i++) {
      const auto &w = samples[i];
      const auto &col_start = colptr_data[w];
      const auto &col_end = colptr_data[w + 1];
      const auto col_count = col_end - col_start;

      if (col_count == 0)
        continue;

rusty1s's avatar
bugfix  
rusty1s committed
46
47
      if ((num_samples < 0) || (!replace && (num_samples >= col_count))) {
        for (int64_t offset = col_start; offset < col_end; offset++) {
rusty1s's avatar
rusty1s committed
48
49
50
51
52
53
54
55
56
57
          const int64_t &v = row_data[offset];
          const auto res = to_local_node.insert({v, samples.size()});
          if (res.second)
            samples.push_back(v);
          if (directed) {
            cols.push_back(i);
            rows.push_back(res.first->second);
            edges.push_back(offset);
          }
        }
rusty1s's avatar
bugfix  
rusty1s committed
58
59
      } else if (replace) {
        for (int64_t j = 0; j < num_samples; j++) {
60
          const int64_t offset = col_start + uniform_randint(col_count);
rusty1s's avatar
rusty1s committed
61
62
63
64
65
66
67
68
69
70
71
72
73
          const int64_t &v = row_data[offset];
          const auto res = to_local_node.insert({v, samples.size()});
          if (res.second)
            samples.push_back(v);
          if (directed) {
            cols.push_back(i);
            rows.push_back(res.first->second);
            edges.push_back(offset);
          }
        }
      } else {
        unordered_set<int64_t> rnd_indices;
        for (int64_t j = col_count - num_samples; j < col_count; j++) {
74
          int64_t rnd = uniform_randint(j);
rusty1s's avatar
rusty1s committed
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
          if (!rnd_indices.insert(rnd).second) {
            rnd = j;
            rnd_indices.insert(j);
          }
          const int64_t offset = col_start + rnd;
          const int64_t &v = row_data[offset];
          const auto res = to_local_node.insert({v, samples.size()});
          if (res.second)
            samples.push_back(v);
          if (directed) {
            cols.push_back(i);
            rows.push_back(res.first->second);
            edges.push_back(offset);
          }
        }
      }
    }
    begin = end, end = samples.size();
  }

  if (!directed) {
    unordered_map<int64_t, int64_t>::iterator iter;
    for (int64_t i = 0; i < (int64_t)samples.size(); i++) {
      const auto &w = samples[i];
      const auto &col_start = colptr_data[w];
      const auto &col_end = colptr_data[w + 1];
      for (int64_t offset = col_start; offset < col_end; offset++) {
        const auto &v = row_data[offset];
        iter = to_local_node.find(v);
        if (iter != to_local_node.end()) {
          rows.push_back(iter->second);
          cols.push_back(i);
          edges.push_back(offset);
        }
      }
    }
  }

  return make_tuple(from_vector<int64_t>(samples), from_vector<int64_t>(rows),
                    from_vector<int64_t>(cols), from_vector<int64_t>(edges));
}

Matthias Fey's avatar
Matthias Fey committed
117
118
119
120
bool satisfy_time_constraint(
    const c10::Dict<node_t, torch::Tensor> &node_time_dict,
    const node_t &src_node_type, const int64_t &dst_time,
    const int64_t &src_node) {
Rex Ying's avatar
Rex Ying committed
121
122
  // whether src -> dst obeys the time constraint
  try {
Matthias Fey's avatar
Matthias Fey committed
123
124
125
    auto src_time = node_time_dict.at(src_node_type).data_ptr<int64_t>();
    return dst_time < src_time[src_node];
  } catch (int err) {
Rex Ying's avatar
Rex Ying committed
126
127
128
129
130
131
    // if the node type does not have timestamp, fall back to normal sampling
    return true;
  }
}

template <bool replace, bool directed, bool temporal>
rusty1s's avatar
bugfix  
rusty1s committed
132
133
134
tuple<c10::Dict<node_t, torch::Tensor>, c10::Dict<rel_t, torch::Tensor>,
      c10::Dict<rel_t, torch::Tensor>, c10::Dict<rel_t, torch::Tensor>>
hetero_sample(const vector<node_t> &node_types,
Matthias Fey's avatar
Matthias Fey committed
135
136
137
138
139
140
141
              const vector<edge_t> &edge_types,
              const c10::Dict<rel_t, torch::Tensor> &colptr_dict,
              const c10::Dict<rel_t, torch::Tensor> &row_dict,
              const c10::Dict<node_t, torch::Tensor> &input_node_dict,
              const c10::Dict<rel_t, vector<int64_t>> &num_neighbors_dict,
              const int64_t num_hops,
              const c10::Dict<node_t, torch::Tensor> &node_time_dict) {
rusty1s's avatar
rusty1s committed
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  // Create a mapping to convert single string relations to edge type triplets:
  unordered_map<rel_t, edge_t> to_edge_type;
  for (const auto &k : edge_types)
    to_edge_type[get<0>(k) + "__" + get<1>(k) + "__" + get<2>(k)] = k;

  // Initialize some data structures for the sampling process:
  unordered_map<rel_t, vector<int64_t>> rows_dict, cols_dict, edges_dict;
  for (const auto &kv : colptr_dict) {
    const auto &rel_type = kv.key();
    rows_dict[rel_type];
    cols_dict[rel_type];
    edges_dict[rel_type];
  }

Rex Ying's avatar
Rex Ying committed
156
157
158
159
160
161
162
163
164
165
166
  unordered_map<node_t, vector<int64_t>> samples_dict;
  unordered_map<node_t, unordered_map<int64_t, int64_t>> to_local_node_dict;
  // The timestamp of the center node whose neighborhood that the sampled node
  // belongs to. It maps node_type to empty vector in non-temporal sampling.
  unordered_map<node_t, vector<int64_t>> root_time_dict;
  for (const auto &node_type : node_types) {
    samples_dict[node_type];
    to_local_node_dict[node_type];
    root_time_dict[node_type];
  }

rusty1s's avatar
rusty1s committed
167
168
169
  // Add the input nodes to the output nodes:
  for (const auto &kv : input_node_dict) {
    const auto &node_type = kv.key();
Michał Marcinkiewicz's avatar
Michał Marcinkiewicz committed
170
    const torch::Tensor &input_node = kv.value();
rusty1s's avatar
rusty1s committed
171
    const auto *input_node_data = input_node.data_ptr<int64_t>();
Rex Ying's avatar
Rex Ying committed
172
    // dummy value. will be reset to root time if is_temporal==true
Matthias Fey's avatar
Matthias Fey committed
173
    int64_t *node_time_data;
Rex Ying's avatar
Rex Ying committed
174
175
176
    // root_time[i] stores the timestamp of the computation tree root
    // of the node samples[i]
    if (temporal) {
Matthias Fey's avatar
Matthias Fey committed
177
178
      torch::Tensor node_time = node_time_dict.at(node_type);
      node_time_data = node_time.data_ptr<int64_t>();
Rex Ying's avatar
Rex Ying committed
179
    }
rusty1s's avatar
rusty1s committed
180
181
182

    auto &samples = samples_dict.at(node_type);
    auto &to_local_node = to_local_node_dict.at(node_type);
Rex Ying's avatar
Rex Ying committed
183
    auto &root_time = root_time_dict.at(node_type);
rusty1s's avatar
rusty1s committed
184
185
186
187
    for (int64_t i = 0; i < input_node.numel(); i++) {
      const auto &v = input_node_data[i];
      samples.push_back(v);
      to_local_node.insert({v, i});
Rex Ying's avatar
Rex Ying committed
188
189
190
      if (temporal) {
        root_time.push_back(node_time_data[v]);
      }
rusty1s's avatar
rusty1s committed
191
192
193
194
195
196
197
198
199
200
201
202
203
    }
  }

  unordered_map<node_t, pair<int64_t, int64_t>> slice_dict;
  for (const auto &kv : samples_dict)
    slice_dict[kv.first] = {0, kv.second.size()};

  for (int64_t ell = 0; ell < num_hops; ell++) {
    for (const auto &kv : num_neighbors_dict) {
      const auto &rel_type = kv.key();
      const auto &edge_type = to_edge_type[rel_type];
      const auto &src_node_type = get<0>(edge_type);
      const auto &dst_node_type = get<2>(edge_type);
rusty1s's avatar
bugfix  
rusty1s committed
204
      const auto num_samples = kv.value()[ell];
rusty1s's avatar
rusty1s committed
205
206
207
208
      const auto &dst_samples = samples_dict.at(dst_node_type);
      auto &src_samples = samples_dict.at(src_node_type);
      auto &to_local_src_node = to_local_node_dict.at(src_node_type);

209
210
211
212
      const auto *colptr_data =
          ((torch::Tensor)colptr_dict.at(rel_type)).data_ptr<int64_t>();
      const auto *row_data =
          ((torch::Tensor)row_dict.at(rel_type)).data_ptr<int64_t>();
rusty1s's avatar
rusty1s committed
213
214
215
216
217
218
219

      auto &rows = rows_dict.at(rel_type);
      auto &cols = cols_dict.at(rel_type);
      auto &edges = edges_dict.at(rel_type);

      const auto &begin = slice_dict.at(dst_node_type).first;
      const auto &end = slice_dict.at(dst_node_type).second;
Matthias Fey's avatar
Matthias Fey committed
220
      if (begin == end) {
Rex Ying's avatar
Rex Ying committed
221
222
223
224
225
226
227
        continue;
      }
      // for temporal sampling, sampled src node cannot have timestamp greater
      // than its corresponding dst_root_time
      const auto &dst_root_time = root_time_dict.at(dst_node_type);
      auto &src_root_time = root_time_dict.at(src_node_type);

rusty1s's avatar
rusty1s committed
228
229
      for (int64_t i = begin; i < end; i++) {
        const auto &w = dst_samples[i];
Rex Ying's avatar
Rex Ying committed
230
        const auto &dst_time = dst_root_time[i];
rusty1s's avatar
rusty1s committed
231
232
233
234
235
236
237
        const auto &col_start = colptr_data[w];
        const auto &col_end = colptr_data[w + 1];
        const auto col_count = col_end - col_start;

        if (col_count == 0)
          continue;

rusty1s's avatar
bugfix  
rusty1s committed
238
        if ((num_samples < 0) || (!replace && (num_samples >= col_count))) {
Rex Ying's avatar
Rex Ying committed
239
          // select all neighbors
rusty1s's avatar
bugfix  
rusty1s committed
240
          for (int64_t offset = col_start; offset < col_end; offset++) {
rusty1s's avatar
rusty1s committed
241
            const int64_t &v = row_data[offset];
Rex Ying's avatar
Rex Ying committed
242
243
244
245
246
247
248
            bool time_constraint = true;
            if (temporal) {
              time_constraint = satisfy_time_constraint(
                  node_time_dict, src_node_type, dst_time, v);
            }
            if (!time_constraint)
              continue;
rusty1s's avatar
rusty1s committed
249
            const auto res = to_local_src_node.insert({v, src_samples.size()});
Rex Ying's avatar
Rex Ying committed
250
            if (res.second) {
rusty1s's avatar
rusty1s committed
251
              src_samples.push_back(v);
Rex Ying's avatar
Rex Ying committed
252
253
254
              if (temporal)
                src_root_time.push_back(dst_time);
            }
rusty1s's avatar
rusty1s committed
255
256
257
258
259
260
            if (directed) {
              cols.push_back(i);
              rows.push_back(res.first->second);
              edges.push_back(offset);
            }
          }
rusty1s's avatar
bugfix  
rusty1s committed
261
        } else if (replace) {
Rex Ying's avatar
Rex Ying committed
262
263
264
          // sample with replacement
          int64_t num_neighbors = 0;
          while (num_neighbors < num_samples) {
265
            const int64_t offset = col_start + uniform_randint(col_count);
rusty1s's avatar
rusty1s committed
266
            const int64_t &v = row_data[offset];
Rex Ying's avatar
Rex Ying committed
267
268
269
270
271
272
273
            bool time_constraint = true;
            if (temporal) {
              time_constraint = satisfy_time_constraint(
                  node_time_dict, src_node_type, dst_time, v);
            }
            if (!time_constraint)
              continue;
rusty1s's avatar
rusty1s committed
274
            const auto res = to_local_src_node.insert({v, src_samples.size()});
Rex Ying's avatar
Rex Ying committed
275
            if (res.second) {
rusty1s's avatar
rusty1s committed
276
              src_samples.push_back(v);
Rex Ying's avatar
Rex Ying committed
277
278
279
              if (temporal)
                src_root_time.push_back(dst_time);
            }
rusty1s's avatar
rusty1s committed
280
281
282
283
284
            if (directed) {
              cols.push_back(i);
              rows.push_back(res.first->second);
              edges.push_back(offset);
            }
Rex Ying's avatar
Rex Ying committed
285
            num_neighbors += 1;
rusty1s's avatar
rusty1s committed
286
287
          }
        } else {
Rex Ying's avatar
Rex Ying committed
288
          // sample without replacement
rusty1s's avatar
rusty1s committed
289
290
          unordered_set<int64_t> rnd_indices;
          for (int64_t j = col_count - num_samples; j < col_count; j++) {
291
            int64_t rnd = uniform_randint(j);
rusty1s's avatar
rusty1s committed
292
293
294
295
296
297
            if (!rnd_indices.insert(rnd).second) {
              rnd = j;
              rnd_indices.insert(j);
            }
            const int64_t offset = col_start + rnd;
            const int64_t &v = row_data[offset];
Rex Ying's avatar
Rex Ying committed
298
299
300
301
302
303
304
            bool time_constraint = true;
            if (temporal) {
              time_constraint = satisfy_time_constraint(
                  node_time_dict, src_node_type, dst_time, v);
            }
            if (!time_constraint)
              continue;
rusty1s's avatar
rusty1s committed
305
            const auto res = to_local_src_node.insert({v, src_samples.size()});
Rex Ying's avatar
Rex Ying committed
306
            if (res.second) {
rusty1s's avatar
rusty1s committed
307
              src_samples.push_back(v);
Rex Ying's avatar
Rex Ying committed
308
309
310
              if (temporal)
                src_root_time.push_back(dst_time);
            }
rusty1s's avatar
rusty1s committed
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
            if (directed) {
              cols.push_back(i);
              rows.push_back(res.first->second);
              edges.push_back(offset);
            }
          }
        }
      }
    }

    for (const auto &kv : samples_dict) {
      slice_dict[kv.first] = {slice_dict.at(kv.first).second, kv.second.size()};
    }
  }

  if (!directed) { // Construct the subgraph among the sampled nodes:
    unordered_map<int64_t, int64_t>::iterator iter;
    for (const auto &kv : colptr_dict) {
      const auto &rel_type = kv.key();
      const auto &edge_type = to_edge_type[rel_type];
      const auto &src_node_type = get<0>(edge_type);
      const auto &dst_node_type = get<2>(edge_type);
      const auto &dst_samples = samples_dict.at(dst_node_type);
      auto &to_local_src_node = to_local_node_dict.at(src_node_type);

Michał Marcinkiewicz's avatar
Michał Marcinkiewicz committed
336
      const auto *colptr_data = ((torch::Tensor)kv.value()).data_ptr<int64_t>();
337
338
      const auto *row_data =
          ((torch::Tensor)row_dict.at(rel_type)).data_ptr<int64_t>();
rusty1s's avatar
rusty1s committed
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366

      auto &rows = rows_dict.at(rel_type);
      auto &cols = cols_dict.at(rel_type);
      auto &edges = edges_dict.at(rel_type);

      for (int64_t i = 0; i < (int64_t)dst_samples.size(); i++) {
        const auto &w = dst_samples[i];
        const auto &col_start = colptr_data[w];
        const auto &col_end = colptr_data[w + 1];
        for (int64_t offset = col_start; offset < col_end; offset++) {
          const auto &v = row_data[offset];
          iter = to_local_src_node.find(v);
          if (iter != to_local_src_node.end()) {
            rows.push_back(iter->second);
            cols.push_back(i);
            edges.push_back(offset);
          }
        }
      }
    }
  }

  return make_tuple(from_vector<node_t, int64_t>(samples_dict),
                    from_vector<rel_t, int64_t>(rows_dict),
                    from_vector<rel_t, int64_t>(cols_dict),
                    from_vector<rel_t, int64_t>(edges_dict));
}

Rex Ying's avatar
Rex Ying committed
367
368
369
template <bool replace, bool directed>
tuple<c10::Dict<node_t, torch::Tensor>, c10::Dict<rel_t, torch::Tensor>,
      c10::Dict<rel_t, torch::Tensor>, c10::Dict<rel_t, torch::Tensor>>
Matthias Fey's avatar
Matthias Fey committed
370
371
372
373
374
375
376
hetero_sample_random(
    const vector<node_t> &node_types, const vector<edge_t> &edge_types,
    const c10::Dict<rel_t, torch::Tensor> &colptr_dict,
    const c10::Dict<rel_t, torch::Tensor> &row_dict,
    const c10::Dict<node_t, torch::Tensor> &input_node_dict,
    const c10::Dict<rel_t, vector<int64_t>> &num_neighbors_dict,
    const int64_t num_hops) {
Rex Ying's avatar
Rex Ying committed
377
  c10::Dict<node_t, torch::Tensor> empty_dict;
Matthias Fey's avatar
Matthias Fey committed
378
379
380
  return hetero_sample<replace, directed, false>(
      node_types, edge_types, colptr_dict, row_dict, input_node_dict,
      num_neighbors_dict, num_hops, empty_dict);
Rex Ying's avatar
Rex Ying committed
381
382
}

rusty1s's avatar
rusty1s committed
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
} // namespace

tuple<torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor>
neighbor_sample_cpu(const torch::Tensor &colptr, const torch::Tensor &row,
                    const torch::Tensor &input_node,
                    const vector<int64_t> num_neighbors, const bool replace,
                    const bool directed) {

  if (replace && directed) {
    return sample<true, true>(colptr, row, input_node, num_neighbors);
  } else if (replace && !directed) {
    return sample<true, false>(colptr, row, input_node, num_neighbors);
  } else if (!replace && directed) {
    return sample<false, true>(colptr, row, input_node, num_neighbors);
  } else {
    return sample<false, false>(colptr, row, input_node, num_neighbors);
  }
}

rusty1s's avatar
bugfix  
rusty1s committed
402
403
tuple<c10::Dict<node_t, torch::Tensor>, c10::Dict<rel_t, torch::Tensor>,
      c10::Dict<rel_t, torch::Tensor>, c10::Dict<rel_t, torch::Tensor>>
rusty1s's avatar
rusty1s committed
404
hetero_neighbor_sample_cpu(
rusty1s's avatar
bugfix  
rusty1s committed
405
    const vector<node_t> &node_types, const vector<edge_t> &edge_types,
rusty1s's avatar
rusty1s committed
406
407
408
    const c10::Dict<rel_t, torch::Tensor> &colptr_dict,
    const c10::Dict<rel_t, torch::Tensor> &row_dict,
    const c10::Dict<node_t, torch::Tensor> &input_node_dict,
rusty1s's avatar
bugfix  
rusty1s committed
409
    const c10::Dict<rel_t, vector<int64_t>> &num_neighbors_dict,
rusty1s's avatar
rusty1s committed
410
411
412
    const int64_t num_hops, const bool replace, const bool directed) {

  if (replace && directed) {
Matthias Fey's avatar
Matthias Fey committed
413
414
415
    return hetero_sample_random<true, true>(node_types, edge_types, colptr_dict,
                                            row_dict, input_node_dict,
                                            num_neighbors_dict, num_hops);
Rex Ying's avatar
Rex Ying committed
416
417
  } else if (replace && !directed) {
    return hetero_sample_random<true, false>(
Matthias Fey's avatar
Matthias Fey committed
418
        node_types, edge_types, colptr_dict, row_dict, input_node_dict,
Rex Ying's avatar
Rex Ying committed
419
420
421
        num_neighbors_dict, num_hops);
  } else if (!replace && directed) {
    return hetero_sample_random<false, true>(
Matthias Fey's avatar
Matthias Fey committed
422
        node_types, edge_types, colptr_dict, row_dict, input_node_dict,
Rex Ying's avatar
Rex Ying committed
423
424
425
        num_neighbors_dict, num_hops);
  } else {
    return hetero_sample_random<false, false>(
Matthias Fey's avatar
Matthias Fey committed
426
        node_types, edge_types, colptr_dict, row_dict, input_node_dict,
Rex Ying's avatar
Rex Ying committed
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
        num_neighbors_dict, num_hops);
  }
}

tuple<c10::Dict<node_t, torch::Tensor>, c10::Dict<rel_t, torch::Tensor>,
      c10::Dict<rel_t, torch::Tensor>, c10::Dict<rel_t, torch::Tensor>>
hetero_neighbor_temporal_sample_cpu(
    const vector<node_t> &node_types, const vector<edge_t> &edge_types,
    const c10::Dict<rel_t, torch::Tensor> &colptr_dict,
    const c10::Dict<rel_t, torch::Tensor> &row_dict,
    const c10::Dict<node_t, torch::Tensor> &input_node_dict,
    const c10::Dict<rel_t, vector<int64_t>> &num_neighbors_dict,
    const c10::Dict<node_t, torch::Tensor> &node_time_dict,
    const int64_t num_hops, const bool replace, const bool directed) {

  if (replace && directed) {
    return hetero_sample<true, true, true>(
Matthias Fey's avatar
Matthias Fey committed
444
        node_types, edge_types, colptr_dict, row_dict, input_node_dict,
Rex Ying's avatar
Rex Ying committed
445
        num_neighbors_dict, num_hops, node_time_dict);
rusty1s's avatar
rusty1s committed
446
  } else if (replace && !directed) {
Rex Ying's avatar
Rex Ying committed
447
    return hetero_sample<true, false, true>(
Matthias Fey's avatar
Matthias Fey committed
448
        node_types, edge_types, colptr_dict, row_dict, input_node_dict,
Rex Ying's avatar
Rex Ying committed
449
        num_neighbors_dict, num_hops, node_time_dict);
rusty1s's avatar
rusty1s committed
450
  } else if (!replace && directed) {
Rex Ying's avatar
Rex Ying committed
451
    return hetero_sample<false, true, true>(
Matthias Fey's avatar
Matthias Fey committed
452
        node_types, edge_types, colptr_dict, row_dict, input_node_dict,
Rex Ying's avatar
Rex Ying committed
453
        num_neighbors_dict, num_hops, node_time_dict);
rusty1s's avatar
rusty1s committed
454
  } else {
Rex Ying's avatar
Rex Ying committed
455
    return hetero_sample<false, false, true>(
Matthias Fey's avatar
Matthias Fey committed
456
        node_types, edge_types, colptr_dict, row_dict, input_node_dict,
Rex Ying's avatar
Rex Ying committed
457
        num_neighbors_dict, num_hops, node_time_dict);
rusty1s's avatar
rusty1s committed
458
459
  }
}