[Other] Add namespace for functions (#538)

Add namespace for functions
This commit is contained in:
Jason
2022-11-09 13:57:53 +08:00
committed by GitHub
parent 4706a7c32a
commit f2fed7959b
27 changed files with 63 additions and 61 deletions

View File

@@ -187,11 +187,11 @@ struct ErnieForSequenceClassificationPredictor {
std::vector<SeqClsResult>* seq_cls_results) {
const auto& logits = outputs[0];
fastdeploy::FDTensor probs;
fastdeploy::Softmax(logits, &probs);
fastdeploy::function::Softmax(logits, &probs);
fastdeploy::FDTensor labels, confidences;
fastdeploy::Max(probs, &confidences, {-1});
fastdeploy::ArgMax(probs, &labels, -1);
fastdeploy::function::Max(probs, &confidences, {-1});
fastdeploy::function::ArgMax(probs, &labels, -1);
if (labels.Numel() != confidences.Numel()) {
return false;
}