# Is that ok not using 'criterion.cuda()' before criterion?

**URL:** <https://discuss.pytorch.org/t/is-that-ok-not-using-criterion-cuda-before-criterion/85716>\
**Category:** Uncategorized\
**Created:** [June 17, 2020, 2:47am UTC](https://discuss.pytorch.org/t/is-that-ok-not-using-criterion-cuda-before-criterion/85716 "2020-06-17T02:47:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samr1104](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/samr1104/32/25633_2.png) [@samr1104](https://discuss.pytorch.org/u/samr1104)\
**Post date:** [June 17, 2020, 2:47am UTC](https://discuss.pytorch.org/t/is-that-ok-not-using-criterion-cuda-before-criterion/85716/1 "2020-06-17T02:47:50Z")

</div>

Is that ok not using ‘criterion.cuda()’ before criterion?

---

<div class="post-metadata">

**Author:** ![Nikronic](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/nikronic/32/71873_2.png) [@Nikronic](https://discuss.pytorch.org/u/Nikronic)\
**Post date:** [June 17, 2020, 3:21am UTC](https://discuss.pytorch.org/t/is-that-ok-not-using-criterion-cuda-before-criterion/85716/2 "2020-06-17T03:21:47Z")

</div>

Hi,

If I want to summarize, you only need to use `.cuda` on criterion if the criterion function has parameters.

Here is the posts related to this situation: [Move the loss function to GPU](https://discuss.pytorch.org/t/move-the-loss-function-to-gpu/20060) and [Why `criterion.cuda()` is not needed but `model.cuda()` is?](https://discuss.pytorch.org/t/why-criterion-cuda-is-not-needed-but-model-cuda-is/17410/2)

Bests

---

<div class="post-metadata">

**Author:** ![samr1104](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/samr1104/32/25633_2.png) [@samr1104](https://discuss.pytorch.org/u/samr1104)\
**Post date:** [June 17, 2020, 3:55am UTC](https://discuss.pytorch.org/t/is-that-ok-not-using-criterion-cuda-before-criterion/85716/3 "2020-06-17T03:55:52Z")

</div>

thx, it really helps! 😃
