# DirectML and CrossEntropyLoss

**URL:** <https://discuss.pytorch.org/t/directml-and-crossentropyloss/178372>\
**Category:** vision\
**Created:** [April 24, 2023, 12:27pm UTC](https://discuss.pytorch.org/t/directml-and-crossentropyloss/178372 "2023-04-24T12:27:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_Roman](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/victor_roman/32/58516_2.png) [@Victor\_Roman](https://discuss.pytorch.org/u/Victor_Roman)\
**Post date:** [April 24, 2023, 12:27pm UTC](https://discuss.pytorch.org/t/directml-and-crossentropyloss/178372/1 "2023-04-24T12:27:06Z")

</div>

![image](https://discuss.pytorch.org/uploads/default/original/3X/c/5/c55e9c4baee2f1d6b395fb98285a9a45e9bfbb27.png)  
Hey there, I’ve been trying to make my own first model and I eventually realized I’d need to do a multioutput model.

I’ve done some tinkering and came to this train function but when trying to use directML I’ve ran into this error code:  
RuntimeError: tensor.device().type() == at::DeviceType::PrivateUse1 INTERNAL ASSERT FAILED at “/home/vsts/work/1/s/pytorch-directml-plugin/torch\_directml/csrc/dml/DMLTensor.cpp”:30, please report a bug to PyTorch. unbox expects Dml at::Tensor as inputs

I was wondering if there’s other people in my situation and whether I’ve missed something very simple
