Skip to content

Commit

Permalink
fix the lint and naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbalin committed Aug 21, 2024
1 parent e26eccc commit 66bc1f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions python/dgl/graphbolt/impl/cpu_cached_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def update(self, value: torch.Tensor, ids: torch.Tensor = None):
feat0 = value[:1]
self._fallback_feature.update(value)
cache_size = min(
bytes_to_number_of_items(self.max_cache_size_in_bytes, feat0),
bytes_to_number_of_items(self.cache_size_in_bytes, feat0),
value.shape[0],
)
self._feature = None # Destroy the existing cache first.
Expand All @@ -452,7 +452,8 @@ def is_pinned(self):
return self._feature.is_pinned()

@property
def max_cache_size_in_bytes(self):
def cache_size_in_bytes(self):
"""Return the size taken by the cache in bytes."""
return self._feature.max_size_in_bytes

@property
Expand Down
5 changes: 3 additions & 2 deletions python/dgl/graphbolt/impl/gpu_cached_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def update(self, value: torch.Tensor, ids: torch.Tensor = None):
feat0 = value[:1]
self._fallback_feature.update(value)
cache_size = min(
bytes_to_number_of_items(self.max_cache_size_in_bytes, feat0),
bytes_to_number_of_items(self.cache_size_in_bytes, feat0),
value.shape[0],
)
self._feature = None # Destroy the existing cache first.
Expand All @@ -249,7 +249,8 @@ def update(self, value: torch.Tensor, ids: torch.Tensor = None):
self._feature.replace(ids, value)

@property
def max_cache_size_in_bytes(self):
def cache_size_in_bytes(self):
"""Return the size taken by the cache in bytes."""
return self._feature.max_size_in_bytes

@property
Expand Down

0 comments on commit 66bc1f6

Please sign in to comment.