# Confusion in documentation of CrossEntropyLoss

**URL:** <https://discuss.pytorch.org/t/confusion-in-documentation-of-crossentropyloss/2674>\
**Category:** Uncategorized\
**Created:** [May 5, 2017, 1:30am UTC](https://discuss.pytorch.org/t/confusion-in-documentation-of-crossentropyloss/2674 "2017-05-05T01:30:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kko](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/k/ed8c4c/32.png) [@kko](https://discuss.pytorch.org/u/kko)\
**Post date:** [May 5, 2017, 1:30am UTC](https://discuss.pytorch.org/t/confusion-in-documentation-of-crossentropyloss/2674/1 "2017-05-05T01:30:57Z")

</div>

Hi,  
I am confused while reading documentation of CrossEntropyLoss. Does **n** and **nClasses** are the same thing? If not, what is n?

“It is useful when training a classification problem **with n classes** ”  
…  
“input has to be a 2D Tensor of size batch x **n**.  
This criterion expects a class index (0 to **nClasses** -1) as the target for each value of a 1D tensor of size **n** ”

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [May 5, 2017, 1:58am UTC](https://discuss.pytorch.org/t/confusion-in-documentation-of-crossentropyloss/2674/2 "2017-05-05T01:58:13Z")

</div>

yes, n and nClasses are the same thing.
