def to_dgl_nd_for_write(x):
    """Convert framework-specific tensor/None to dgl ndarray for write."""
    return (
        nd.NULL["int64"]
        if x is None
        else F.zerocopy_to_dgl_ndarray_for_write(x)
    )
Convert framework-specific tensor/None to dgl ndarray for write.
python/dgl/_sparse_ops.py