Skip to content

Commit

Permalink
improve the docstring.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbalin committed Aug 21, 2024
1 parent 5381624 commit c431578
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
13 changes: 6 additions & 7 deletions python/dgl/graphbolt/impl/cpu_cached_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@


class CPUCachedFeature(Feature):
r"""CPU cached feature wrapping a fallback feature.
r"""CPU cached feature wrapping a fallback feature. Use `cpu_feature_cache`
to construct an instance of this class.
Parameters
----------
fallback_feature : Feature
The fallback feature.
cache : CPUFeatureCache
Whether a previously constructed CPUFeatureCache instance should be
used. This is useful if multiple features should share the same cache
instance.
A CPUFeatureCache instance to serve as the cache backend.
offset : int, optional
If a valid cache parameter is given, the offset value to use to separate
the keys mapping to multiple features. Typically it will be a value from
FusedCSCSamplingGraph.node_type_offset.
The offset value to add to the given ids before using the cache. This
parameter is useful if multiple `CPUCachedFeature`s are sharing a single
CPUFeatureCache object.
"""

_cache_type = CPUFeatureCache
Expand Down
10 changes: 4 additions & 6 deletions python/dgl/graphbolt/impl/gpu_cached_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ class GPUCachedFeature(Feature):
fallback_feature : Feature
The fallback feature.
cache : GPUFeatureCache
Whether a previously constructed GPUFeatureCache instance should be
used. This is useful if multiple features should share the same cache
instance.
A GPUFeatureCache instance to serve as the cache backend.
offset : int, optional
If a valid cache parameter is given, the offset value to use to separate
the keys mapping to multiple features. Typically it will be a value from
FusedCSCSamplingGraph.node_type_offset.
The offset value to add to the given ids before using the cache. This
parameter is useful if multiple `GPUCachedFeature`s are sharing a single
GPUFeatureCache object.
Examples
--------
Expand Down

0 comments on commit c431578

Please sign in to comment.