Return the number of integer bits needed to represent the unitgraph graph. Parameters ---------- etype : int The edge type. Returns ------- int The number of bits needed.
(self, etype)
| 198 | return _CAPI_DGLHeteroContext(self) |
| 199 | |
| 200 | def bits_needed(self, etype): |
| 201 | """Return the number of integer bits needed to represent the unitgraph graph. |
| 202 | |
| 203 | Parameters |
| 204 | ---------- |
| 205 | etype : int |
| 206 | The edge type. |
| 207 | |
| 208 | Returns |
| 209 | ------- |
| 210 | int |
| 211 | The number of bits needed. |
| 212 | """ |
| 213 | stype, dtype = self.metagraph.find_edge(etype) |
| 214 | if ( |
| 215 | self.num_edges(etype) >= 0x80000000 |
| 216 | or self.num_nodes(stype) >= 0x80000000 |
| 217 | or self.num_nodes(dtype) >= 0x80000000 |
| 218 | ): |
| 219 | return 64 |
| 220 | else: |
| 221 | return 32 |
| 222 | |
| 223 | def asbits(self, bits): |
| 224 | """Transform the graph to a new one with the given number of bits storage. |
no test coverage detected