dmlc / dmlc/dgl

[Feature Request] Add missing functions in numpy backend.

Open
#664 4 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Python
Stars
14.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

## 🚀 Feature
There are some missing or incompatible functions compared with the interface in numpy backend.
The list is following.

#### Missing
+ [ ] device_type
+ [ ] mean
+ [ ] unsorted_1d_segment_sum
+ [ ] unsorted_1d_segment_mean
+ [ ] zerocopy_to_dgl_ndarray
+ [ ] logical_not
+ [ ] zerocopy_to_dlpack
+ [ ] equal
+ [ ] ndim
+ [ ] sync
+ [ ] zerocopy_from_dlpack
+ [ ] copy_reduce
+ [ ] zerocopy_from_dgl_ndarray
+ [ ] boolean_mask
+ [ ] narrow_row
+ [ ] stack
+ [ ] binary_reduce
+ [ ] device_id
+ [ ] zeros_like

#### Not compatible
+ [ ] zeros `(shape, dtype)` v.s. `(shape, dtype, ctx)`
+ [ ] ones `(shape, dtype)`v.s. `(shape, dtype, ctx)`
+ [ ] full_1d `(length, fill_value)` v.s. `(length, fill_value, dtype, ctx)`

## Motivation
In some scenarios, we just want to use message propogation in dgl (e.g. LPA, PageRank) and thus choose numpy as backend.
However due to the missing or incompatible functions in numpy backend, even the simplest example `send(message_func=dgl.function.copy_src("f", "m"))` will raise an exception.

Do you think it's necessary to completing the missing functions? And if so I can help to add some within my ability.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.