未验证 提交 1b8fe70e 编写于 作者: Z Zhang Ting 提交者: GitHub

fix VLOG, test=develop (#23327)

上级 6bb8206d
...@@ -177,7 +177,7 @@ void OperatorBase::Run(const Scope& scope, const platform::Place& place) { ...@@ -177,7 +177,7 @@ void OperatorBase::Run(const Scope& scope, const platform::Place& place) {
RunImpl(scope, place); RunImpl(scope, place);
} }
VLOG(3) << place << " " << DebugStringEx(&scope); VLOG(3) << GetExecutionPlace(place) << " " << DebugStringEx(&scope);
} catch (platform::EnforceNotMet& exception) { } catch (platform::EnforceNotMet& exception) {
framework::InsertCallStackInfo(Type(), Attrs(), &exception); framework::InsertCallStackInfo(Type(), Attrs(), &exception);
throw std::move(exception); throw std::move(exception);
......
...@@ -192,6 +192,11 @@ class OperatorBase { ...@@ -192,6 +192,11 @@ class OperatorBase {
const platform::Place& place, const platform::Place& place,
const RuntimeContext& ctx) const {} const RuntimeContext& ctx) const {}
virtual platform::Place GetExecutionPlace(
const platform::Place& place) const {
return place;
}
protected: protected:
std::string type_; std::string type_;
// NOTE: in case of OpGrad, inputs_ contains: // NOTE: in case of OpGrad, inputs_ contains:
...@@ -479,6 +484,11 @@ class OperatorWithKernel : public OperatorBase { ...@@ -479,6 +484,11 @@ class OperatorWithKernel : public OperatorBase {
const std::string& var_name, const Tensor& tensor, const std::string& var_name, const Tensor& tensor,
const OpKernelType& expected_kernel_type) const; const OpKernelType& expected_kernel_type) const;
virtual platform::Place GetExecutionPlace(
const platform::Place& platform) const {
return kernel_type_->place_;
}
private: private:
void ParseInputDataType(const ExecutionContext& ctx, const std::string& name, void ParseInputDataType(const ExecutionContext& ctx, const std::string& name,
proto::VarType::Type* type) const; proto::VarType::Type* type) const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册