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



##########
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 I am confused with the `tag` in topi (ones in `topi/tags.h`) and 
the `OpPatternKind` in `relay/op_attr_types.h`. It seems that they are not 
matched. Could you tell me the usage of them in tvm? Thank you~




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