docstr: Forward model.
docstr_tok: ["Forward","model","."]
code: def _forward(
      self, x: Tensor, edge_index: Tensor, edge_weight: Tensor, **kwargs
  ) -> Tensor:
      """Forward model."""
      self.model.reset_parameters()
  
      with torch.enable_grad():
          ped = copy.copy(data)
          ped.x, ped.edge_index, ped.edge_weight = (
              x,
              edge_index,
              edge_weight,
          )
          train(self.model, ped, n_epochs, lr, weight_decay)
  
      self.model.eval()
      return self.model(x, edge_index, edge_weight)
  
file_path: pytorch_geometric/examples/contrib/rbcd_attack_poisoning.py
imports: import copy
  import os.path
  import sys
  from typing import Optional, Tuple
  import matplotlib.pyplot
  import torch
  import torch.nn.functional
  from rbcd_attack import GCN, metric, test, train
  from torch import Tensor
  from torch.optim import Adam
  import torch_geometric.transforms
  from torch_geometric.contrib.nn import PRBCDAttack
  from torch_geometric.datasets import Planetoid
label_desc: Use image node_id 1 for calling the PoisoningPRBCDAttack obj's underlying member method code with example usage: obj._forward(x, edge_index, edge_weight) and returns: self