forked from huawei/mindspore2022
add NHWC format requirement of topk ops
This commit is contained in:
parent
a9fcea2ca6
commit
1957afa243
|
|
@ -60,6 +60,10 @@ int TopK::InferShape(std::vector<Tensor *> inputs_, std::vector<Tensor *> output
|
|||
}
|
||||
auto input = inputs_.front();
|
||||
MS_ASSERT(input != nullptr);
|
||||
if (input->format() != schema::Format::Format_NHWC) {
|
||||
MS_LOG(ERROR) << "topk only support NHWC now!";
|
||||
return RET_FORMAT_ERR;
|
||||
}
|
||||
auto output0 = outputs_.front();
|
||||
MS_ASSERT(output0 != nullptr);
|
||||
auto output1 = outputs_.at(1);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ static const std::vector<schema::PrimitiveType> nhwcOpList = {
|
|||
schema::PrimitiveType_BiasAdd,
|
||||
schema::PrimitiveType_InstanceNorm,
|
||||
schema::PrimitiveType_SpaceToDepth,
|
||||
schema::PrimitiveType_DepthToSpace};
|
||||
schema::PrimitiveType_DepthToSpace,
|
||||
schema::PrimitiveType_TopK};
|
||||
|
||||
static const std::vector<schema::PrimitiveType> nhwcOpAllInputList = {
|
||||
#ifdef SUPPORT_TRAIN
|
||||
|
|
|
|||
Loading…
Reference in New Issue