class_docstr: drop constant features
class_docstr_tok: ["drop","constant","features"]
code: def _fit(
      self,
      data: typing.Union[
          autogl.data.graph.GeneralStaticGraph, typing.Any
      ],
  ) -> typing.Union[autogl.data.graph.GeneralStaticGraph, typing.Any]:
      if isinstance(data, autogl.data.graph.GeneralStaticGraph):
          if "x" in data.nodes.data:
              feature: typing.Optional[np.ndarray] = data.nodes.data[
                  "x"
              ].numpy()
          elif "feat" in data.nodes.data:
              feature: typing.Optional[np.ndarray] = data.nodes.data[
                  "feat"
              ].numpy()
          else:
              feature: typing.Optional[np.ndarray] = None
      elif (
          hasattr(data, "x")
          and isinstance(data.x, torch.Tensor)
          and torch.is_tensor(data.x)
          and data.x.dim() == 2
      ):
          feature: typing.Optional[np.ndarray] = data.x.numpy()
      else:
          feature: typing.Optional[np.ndarray] = None
  
      if (
          feature is not None
          and isinstance(feature, np.ndarray)
          and feature.ndim == 2
      ):
          self._selection: typing.Optional[
              torch.Tensor
          ] = torch.from_numpy(
              np.where(
                  np.all(feature == feature[0, :], axis=0)
                  == np.array(False)
              )[0]
          )
      else:
          self._selection: typing.Optional[torch.Tensor] = None
      return data
  
file_path: AutoGL/autogl/module/preprocessing/feature_engineering/_selectors/_basic.py
imports: import numpy
  import torch
  import typing
  import autogl.data.graph
  from .._feature_engineer import FeatureEngineer
  from ..._data_preprocessor_registry import DataPreprocessorUniversalRegistry
label_desc: Use image node_id 1 for calling the FilterConstant obj's underlying member method code with example usage: obj._fit(data) and returns: data