remove const of mutable device info

This commit is contained in:
liuchongming 2023-02-13 23:57:04 +08:00
parent d283a1ef26
commit bb8029f0bb
4 changed files with 4 additions and 4 deletions

View File

@ -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_;

View File

@ -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;
}

View File

@ -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.";

View File

@ -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.";