Misc.
| 1709 | // Misc. |
| 1710 | // ************************ |
| 1711 | Tensor CrossEntropyFwd(const Tensor &p, const Tensor &t) { |
| 1712 | Tensor loss({p.shape(0)}, p.device(), p.data_type()); |
| 1713 | ComputeCrossEntropy(p, t, &loss); |
| 1714 | return loss; |
| 1715 | } |
| 1716 | |
| 1717 | Tensor SoftmaxCrossEntropyBwd(const Tensor &p, const Tensor &t) { |
| 1718 | Tensor g = p.Clone(); |