Prediction code snippet for graphormer on graph classification tasks.
### System Info

Kindly share the code snippet of prediction for graphormer model.

### Who can help?

cc @clefourrier

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

1) Train the model for ogl data.
2) Using trainer.predict to get the prediction dataset results.
3) Unable to write common prediction code for validation dataset without trainer.predict
4) This requires trainer.train to get completed every time.
5) Kindly share the snippet similar to normal text classification and other tasks.

### Expected behavior

Prediction code snippet for graphormer on graph classification tasks.
Hi, could you share the logs that you got at step 3?<|||||>> Hi, could you share the logs that you got at step 3?


Now I'm able to write out prediction code independently.

Code Snippet :

#  For validation, Kindly opt only one data alone from the dataset.
val_ds1 =  val_ds.select(list(range(0,1)))
#  Trainer prediction
preds = trainer.predict(val_ds1)
# Output : PredictionOutput(predictions=(array([[ 3.615392, -2.313876]], dtype=float32),

# Independent prediction code

inputs = dict()
dataset_processed['train'][0] = val_ds1[0]
import torch
inputs['input_nodes'] = torch.tensor([dataset_processed['train'][0]['input_nodes']])
inputs['input_edges'] = torch.tensor([dataset_processed['train'][0]['input_edges']])
inputs['attn_bias'] = torch.tensor([dataset_processed['train'][0]['attn_bias']])
inputs['in_degree'] = torch.tensor([dataset_processed['train'][0]['in_degree']])
inputs['out_degree'] = torch.tensor([dataset_processed['train'][0]['out_degree']])
inputs['spatial_pos'] = torch.tensor([dataset_processed['train'][0]['spatial_pos']])
inputs['attn_edge_type'] = torch.tensor([dataset_processed['train'][0]['attn_edge_type']])


from transformers import GraphormerForGraphClassification

model_checkpoint = "/content/graph-classification/checkpoint-1029" # pre-trained model from which to fine-tune

model = GraphormerForGraphClassification.from_pretrained(
    model_checkpoint, 
    num_classes=2,
    ignore_mismatched_sizes = True, # provide this in case you're planning to fine-tune an already fine-tuned checkpoint
)
with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()
predicted_class_id,logits

#  Output : (0, tensor([[ 3.6154, -2.3139]]))

Works as expected. Hence closing this issue. Thanks a lot.