# DistilBERT multiclass classification example

**URL:** <https://discuss.huggingface.co/t/distilbert-multiclass-classification-example/40572>\
**Category:** 🤗Transformers\
**Created:** [May 22, 2023, 5:01am UTC](https://discuss.huggingface.co/t/distilbert-multiclass-classification-example/40572 "2023-05-22T05:01:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HemanthSai7](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hemanthsai7/32/39341_2.png) [@HemanthSai7](https://discuss.huggingface.co/u/HemanthSai7)\
**Post date:** [May 22, 2023, 5:01am UTC](https://discuss.huggingface.co/t/distilbert-multiclass-classification-example/40572/1 "2023-05-22T05:01:10Z")

</div>

```auto
def forward(self,input_ids,attention_mask):
      output_1 = self.l1(input_ids=input_ids, attention_mask=attention_mask)
      print(output_1.last_hidden_state.shape)
      hidden_state=output_1[0]
      # assert output_1.last_hidden_state.shape == output_1[0].shape
      pooler=hidden_state[:,0]
      assert output_1.last_hidden_state.shape == pooler.shape
      logits=self.classifier(pooler)
      return logits 

```

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/5/d/5d3aef6e22e97a8bb76c964690c0686f16613631.png)

Why the need for slicing `hidden_state[:,0]`. What does this signify? I’m unable to understand this step.
