class_docstr: An implementation of an in-memory heterogeneous layer-wise sampler
  user by :class:`~torch_geometric.loader.HGTLoader`.
class_docstr_tok: ["An","implementation","of","an","in-memory","heterogeneous","layer-wise","sampler","user","by",":","class",":","`","~torch_geometric.loader.HGTLoader","`","."]
code: def sample_from_nodes(
      self,
      inputs: NodeSamplerInput,
  ) -> HeteroSamplerOutput:
      node, row, col, edge = torch.ops.torch_sparse.hgt_sample(
          self.colptr_dict,
          self.row_dict,
          {inputs.input_type: inputs.node},
          self.num_samples,
          self.num_hops,
      )
  
      return HeteroSamplerOutput(
          node=node,
          row=remap_keys(row, self.to_edge_type),
          col=remap_keys(col, self.to_edge_type),
          edge=remap_keys(edge, self.to_edge_type),
          batch=None,
          metadata=(inputs.input_id, inputs.time),
      )
  
file_path: pytorch_geometric/torch_geometric/sampler/hgt_sampler.py
imports: from typing import Dict, List, Union
  import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.sampler import BaseSampler, HeteroSamplerOutput, NodeSamplerInput
  from torch_geometric.sampler.utils import remap_keys, to_hetero_csc
  from torch_geometric.typing import WITH_TORCH_SPARSE, EdgeType, NodeType, OptTensor
label_desc: Use image node_id 2 for calling the HGTSampler obj's underlying member method code with example usage: obj.sample_from_nodes(inputs) and returns: HeteroSamplerOutput