# Why Trainer.predict return numpy array not torch Tensor?

**URL:** <https://discuss.huggingface.co/t/why-trainer-predict-return-numpy-array-not-torch-tensor/48105>\
**Category:** 🤗Transformers\
**Created:** [July 25, 2023, 3:18pm UTC](https://discuss.huggingface.co/t/why-trainer-predict-return-numpy-array-not-torch-tensor/48105 "2023-07-25T15:18:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![usefulhyun](https://avatars.discourse-cdn.com/v4/letter/u/7993a0/32.png) [@usefulhyun](https://discuss.huggingface.co/u/usefulhyun)\
**Post date:** [July 25, 2023, 3:18pm UTC](https://discuss.huggingface.co/t/why-trainer-predict-return-numpy-array-not-torch-tensor/48105/1 "2023-07-25T15:18:57Z")

</div>

I have found that `Trainer.predict` returns a prediction using NumPy arrays as output.  
However, I believe they likely make use of Torch tensors internally during training and evaluation.  
Do you have any insights into why the return value is of type NumPy instead of Torch tensors?  
Any help would be appreciated!

> **[Trainer](https://huggingface.co/docs/transformers/main_classes/trainer#transformers.Trainer.predict)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.
