altanh commented on a change in pull request #8056:
URL: https://github.com/apache/tvm/pull/8056#discussion_r638225020
##########
File path: include/tvm/topi/nn.h
##########
@@ -642,6 +643,54 @@ inline tvm::te::Tensor batch_to_space_nd(const
tvm::te::Tensor& data,
out = strided_slice(out, begin_idx, end_idx, strides);
return out;
}
+
+/*!
+ * \brief Negative log likelihood loss.
+ *
+ * \param predictions The prediction tensor.
+ * \param targets The target tensor.
+ * \param weights A manual rescaling weight given to each class.
+ * \param reduction The reduction method to apply to the output.
+ * \param ignore_index The target value to ignore.
+ * \param name The name of the operation.
+ * \param tag The tag to mark the operation.
+ *
+ * \return A Tensor whose op member is the batch_to_space_nd operation
+ */
+inline Tensor nll_loss(const Tensor& predictions, const Tensor& targets, const
Tensor& weights,
+ std::string reduction = "mean", int ignore_index = -100,
+ const std::string name = "nll_loss", const std::string
tag = kBroadcast) {
Review comment:
I see, that is confusing.. I'll get back to you on this soon
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]