Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update
  • Loading branch information
mufeili committed Jan 8, 2021
commit c429f14a5b5a47e6963b7e1612948590502bc62b
11 changes: 5 additions & 6 deletions src/graph/unit_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1441,12 +1441,11 @@ HeteroGraphPtr UnitGraph::GetGraphInFormat(dgl_format_code_t formats, bool store
if (formats & csr_code)
CHECK(store_eid) << "must store EID array in the case of CSR format";
return CreateFromCSR(num_vtypes, GetOutCSR(false)->adj(), formats);
if (formats & csc_code)
if (store_eid)
return CreateFromCSC(num_vtypes, GetInCSR(false)->adj(), formats);
const aten::CSRMatrix& mat = GetInCSR(false)->adj();
return CreateFromCSC(num_vtypes, mat.num_rows, mat.num_cols,
mat.indptr, mat.indices, aten::NullArray(), formats);
if (store_eid)
return CreateFromCSC(num_vtypes, GetInCSR(false)->adj(), formats);
const aten::CSRMatrix& mat = GetInCSR(false)->adj();
return CreateFromCSC(num_vtypes, mat.num_rows, mat.num_cols,
mat.indptr, mat.indices, aten::NullArray(), formats);
}

SparseFormat UnitGraph::SelectFormat(dgl_format_code_t preferred_formats) const {
Expand Down