# Strange behavior of functional.interpolate during training

**URL:** <https://discuss.pytorch.org/t/strange-behavior-of-functional-interpolate-during-training/133802>\
**Category:** vision\
**Created:** [October 9, 2021, 1:05pm UTC](https://discuss.pytorch.org/t/strange-behavior-of-functional-interpolate-during-training/133802 "2021-10-09T13:05:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Lee](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/james_lee/32/29487_2.png) [@James\_Lee](https://discuss.pytorch.org/u/James_Lee)\
**Post date:** [October 9, 2021, 1:05pm UTC](https://discuss.pytorch.org/t/strange-behavior-of-functional-interpolate-during-training/133802/1 "2021-10-09T13:05:23Z")

</div>

Hi. This is the line of code that leads to strange behavior.

```auto
        labels1 = functional.interpolate(labels, size=24, mode='bilinear')

        print("### labels.long().min()", labels.long().min())
        print("### labels.min()", labels.min())

        print("### labels1.long().min()", labels1.long().min())
        print("### labels1.min()", labels1.min())

```

I got,

```auto
### labels.long().min() tensor(-1, device='cuda:2')
### labels.min() tensor(-1., device='cuda:2')
### labels1.long().min() tensor(0, device='cuda:2')
### labels1.min() tensor(0., device='cuda:2')

```

What’s wrong with functional.interpolate here? Why did the labels.long().min() differ from labels1.min()? Thanks.

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [October 10, 2021, 10:34pm UTC](https://discuss.pytorch.org/t/strange-behavior-of-functional-interpolate-during-training/133802/2 "2021-10-10T22:34:57Z")

</div>

Double post from [here](https://discuss.pytorch.org/t/assertion-t-0-t-n-classes-failed-error/133794/6).
