Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhenze Wang committed Aug 13, 2024
1 parent 80d07f6 commit 7e08ac5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ struct FunctionProto final {
void operator=(const FunctionProto&) = delete;
};

struct OpSchema final{
struct OpSchema final {
const TypeConstraintMap& typeConstraintMap() const { return g_host->OpSchema__typeConstraintMap(this); }
const std::string& inputs__GetName(const int i) const { return g_host->OpSchema__inputs__GetName(this, i); };
const std::string& inputs__GetTypeStr(const int i) const { return g_host->OpSchema__inputs__GetTypeStr(this, i); };
Expand Down
6 changes: 3 additions & 3 deletions onnxruntime/core/providers/vitisai/imp/global_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void create_kernel_registry(std::vector<OrtCustomOpDomain*> domains) {
for (size_t i = 0; i < input_count; i++) {
const auto input_type = op->GetInputType(op, i);
auto input_name = schema->inputs__GetName(i);
if ( schema->typeConstraintMap().count(schema->inputs__GetTypeStr(i))){
if (schema->typeConstraintMap().count(schema->inputs__GetTypeStr(i))) {
input_name = schema->inputs__GetTypeStr(i);
}
if (input_type == ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED) {
Expand All @@ -227,14 +227,14 @@ void create_kernel_registry(std::vector<OrtCustomOpDomain*> domains) {
const auto output_type = op->GetOutputType(op, i);
auto output_name = schema->outputs__GetName(i);
if (schema != nullptr) {
if ( schema->typeConstraintMap().count(schema->outputs__GetTypeStr(i))){
if (schema->typeConstraintMap().count(schema->outputs__GetTypeStr(i))) {
output_name = schema->outputs__GetTypeStr(i);
}
}
if (output_type == ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED) {
def_builder->TypeConstraint(output_name.c_str(), DataTypeImpl::AllTensorTypes());
} else {
def_builder->TypeConstraint(output_name.c_str(),DataTypeImpl::GetTensorTypeFromOnnxType(output_type));
def_builder->TypeConstraint(output_name.c_str(), DataTypeImpl::GetTensorTypeFromOnnxType(output_type));
}
}
KernelCreateFn kernel_create_fn =
Expand Down

0 comments on commit 7e08ac5

Please sign in to comment.