altanh commented on a change in pull request #8056:
URL: https://github.com/apache/tvm/pull/8056#discussion_r644227455



##########
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:
       > @altanh Could you take a look at the tests? Thank you~ And I wonder if 
there is any update with the `tag` and `OpPatternKind`?
   
   I don't have much of an update for the tag, maybe you could try leaving it 
empty string? 




-- 
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]


Reply via email to