class_docstr: GPU cached feature wrapping a fallback feature.
  
  Places the GPU cache to torch.cuda.current_device().
  
  Parameters
  ----------
  fallback_feature : Feature
      The fallback feature.
  cache_size : int
      The capacity of the GPU cache, the number of features to store.
  
  Examples
  --------
  >>> import torch
  >>> from dgl import graphbolt as gb
  >>> torch_feat = torch.arange(10).reshape(2, -1).to("cuda")
  >>> cache_size = 5
  >>> fallback_feature = gb.TorchBasedFeature(torch_feat)
  >>> feature = gb.GPUCachedFeature(fallback_feature, cache_size)
  >>> feature.read()
  tensor([[0, 1, 2, 3, 4],
          [5, 6, 7, 8, 9]], device='cuda:0')
  >>> feature.read(torch.tensor([0]).to("cuda"))
  tensor([[0, 1, 2, 3, 4]], device='cuda:0')
  >>> feature.update(torch.tensor([[1 for _ in range(5)]]).to("cuda"),
  ...                torch.tensor([1]).to("cuda"))
  >>> feature.read(torch.tensor([0, 1]).to("cuda"))
  tensor([[0, 1, 2, 3, 4],
          [1, 1, 1, 1, 1]], device='cuda:0')
  >>> feature.size()
  torch.Size([5])
code: def __init__(self, fallback_feature: Feature, cache_size: int):
      super(GPUCachedFeature, self).__init__()
      assert isinstance(fallback_feature, Feature), (
          f"The fallback_feature must be an instance of Feature, but got "
          f"{type(fallback_feature)}."
      )
      self._fallback_feature = fallback_feature
      self.cache_size = cache_size
      # Fetching the feature dimension from the underlying feature.
      feat0 = fallback_feature.read(torch.tensor([0]))
      self.item_shape = (-1,) + feat0.shape[1:]
      feat0 = torch.reshape(feat0, (1, -1))
      self.flat_shape = (-1, feat0.shape[1])
      self._feature = GPUCache(cache_size, feat0.shape[1])
  
file_path: dgl/python/dgl/graphbolt/impl/gpu_cached_feature.py
imports: import torch
  from dgl.cuda import GPUCache
  from ..feature_store import Feature
label_desc: Use image node_id 1 to create a new GPUCachedFeature object from inherited base classes: Feature with example: obj = GPUCachedFeature(fallback_feature, cache_size)