remove const of mutable device info
This commit is contained in:
parent
d283a1ef26
commit
bb8029f0bb
|
@ -147,7 +147,7 @@ class MS_API Context {
|
|||
/// heterogeneous scenarios with multiple members in the vector.
|
||||
///
|
||||
/// \return Mutable reference of DeviceInfoContext vector in this context.
|
||||
std::vector<std::shared_ptr<DeviceInfoContext>> &MutableDeviceInfo() const;
|
||||
std::vector<std::shared_ptr<DeviceInfoContext>> &MutableDeviceInfo();
|
||||
|
||||
private:
|
||||
std::shared_ptr<Data> data_;
|
||||
|
|
|
@ -95,7 +95,7 @@ std::vector<int32_t> Context::GetThreadAffinityCoreList() const {
|
|||
return data_->affinity_core_list_;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<DeviceInfoContext>> &Context::MutableDeviceInfo() const {
|
||||
std::vector<std::shared_ptr<DeviceInfoContext>> &Context::MutableDeviceInfo() {
|
||||
MS_EXCEPTION_IF_NULL(data_);
|
||||
return data_->device_info_list;
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ bool Context::GetMultiModalHW() const {
|
|||
return data_->float_mode;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<DeviceInfoContext>> &Context::MutableDeviceInfo() const {
|
||||
std::vector<std::shared_ptr<DeviceInfoContext>> &Context::MutableDeviceInfo() {
|
||||
static std::vector<std::shared_ptr<DeviceInfoContext>> empty{};
|
||||
if (data_ == nullptr) {
|
||||
MS_LOG(ERROR) << "Invalid context.";
|
||||
|
|
|
@ -231,7 +231,7 @@ bool Context::GetMultiModalHW() const {
|
|||
return data_->float_mode;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<DeviceInfoContext>> &Context::MutableDeviceInfo() const {
|
||||
std::vector<std::shared_ptr<DeviceInfoContext>> &Context::MutableDeviceInfo() {
|
||||
static std::vector<std::shared_ptr<DeviceInfoContext>> empty{};
|
||||
if (data_ == nullptr) {
|
||||
MS_LOG(ERROR) << "Invalid context.";
|
||||
|
|
Loading…
Reference in New Issue