onnxruntime/onnxruntime/core/framework/customregistry.cc
utsabsingharoy 36ed91ee9f CustomRegistry should use composition instead of inheritence
CustomRegistry should use composition instead of inheritence
2019-04-05 14:14:10 -07:00

32 lines
1.1 KiB
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "core/framework/customregistry.h"
namespace onnxruntime {
common::Status CustomRegistry::RegisterCustomKernel(KernelDefBuilder& kernel_def_builder, const KernelCreateFn& kernel_creator) {
return kernel_registry_->Register(kernel_def_builder, kernel_creator);
}
common::Status CustomRegistry::RegisterCustomKernel(KernelCreateInfo& create_info) {
return kernel_registry_->Register(std::move(create_info));
}
common::Status CustomRegistry::RegisterOpSet(
std::vector<ONNX_NAMESPACE::OpSchema>& schemas,
const std::string& domain,
int baseline_opset_version,
int opset_version) {
return opschema_registry_->RegisterOpSet(schemas, domain, baseline_opset_version, opset_version);
}
const std::shared_ptr<KernelRegistry>& CustomRegistry::GetKernelRegistry() {
return kernel_registry_;
}
const std::shared_ptr<onnxruntime::OnnxRuntimeOpSchemaRegistry>& CustomRegistry::GetOpschemaRegistry() {
return opschema_registry_;
}
} // namespace onnxruntime