code: def cls_encode(self, data) -> torch.Tensor:
      if (
          hasattr(data, "edge_indexes")
          and isinstance(
              getattr(data, "edge_indexes"), _typing.Sequence
          )
          and len(getattr(data, "edge_indexes"))
          == len(self.__sequential_encoding_layers)
      ):
          for __edge_index in getattr(data, "edge_indexes"):
              if type(__edge_index) != torch.Tensor:
                  raise TypeError
          """ Layer-wise encode """
          x: torch.Tensor = getattr(data, "x")
          for i, __edge_index in enumerate(
              getattr(data, "edge_indexes")
          ):
              x: torch.Tensor = self.__sequential_encoding_layers[i](
                  autogl.data.Data(x=x, edge_index=__edge_index)
              )
          return x
      else:
          x: torch.Tensor = getattr(data, "x")
          for i in range(len(self.__sequential_encoding_layers)):
              x = self.__sequential_encoding_layers[i](
                  autogl.data.Data(x, getattr(data, "edge_index"))
              )
          return x
  
imports: import torch
  import typing
  from torch_geometric.nn.conv import SAGEConv
  import torch.nn.functional
  import autogl.data
  from .None import register_model
  from .base import BaseAutoModel, activate_func, ClassificationSupportedSequentialModel
  from ....utils import get_logger
label_desc: Use image node_id 3 for calling the GraphSAGE obj's underlying member method code with example usage: obj.cls_encode(data) and returns: x, x