未验证 提交 8113de94 编写于 作者: A Abhinav Arora 提交者: GitHub

Fix more CPPLint errors (#10069)

上级 bb4b9af7
...@@ -29,11 +29,11 @@ namespace paddle { ...@@ -29,11 +29,11 @@ namespace paddle {
namespace operators { namespace operators {
void SetReceiveStatus(const platform::Place &dev_place, void SetReceiveStatus(const platform::Place &dev_place,
framework::Variable &status_var, bool status) { framework::Variable *status_var, bool status) {
auto cpu = platform::CPUPlace(); auto cpu = platform::CPUPlace();
auto status_tensor = auto status_tensor =
status_var.GetMutable<framework::LoDTensor>()->mutable_data<bool>({1}, status_var->GetMutable<framework::LoDTensor>()->mutable_data<bool>({1},
cpu); cpu);
status_tensor[0] = status; status_tensor[0] = status;
} }
...@@ -66,7 +66,7 @@ class ChannelRecvOp : public framework::OperatorBase { ...@@ -66,7 +66,7 @@ class ChannelRecvOp : public framework::OperatorBase {
bool ok = concurrency::ChannelReceive(ch, output_var); bool ok = concurrency::ChannelReceive(ch, output_var);
// Set the status output of the `ChannelReceive` call. // Set the status output of the `ChannelReceive` call.
SetReceiveStatus(dev_place, *scope.FindVar(Output(Status)), ok); SetReceiveStatus(dev_place, scope.FindVar(Output(Status)), ok);
} }
}; };
......
...@@ -47,7 +47,7 @@ class ConditionalOp : public framework::OperatorBase { ...@@ -47,7 +47,7 @@ class ConditionalOp : public framework::OperatorBase {
if (!(ips.size() == 1UL && ips[0]->IsInitialized())) { if (!(ips.size() == 1UL && ips[0]->IsInitialized())) {
PADDLE_THROW("should have one initialized input as condition"); PADDLE_THROW("should have one initialized input as condition");
} }
if (!(ips[0]->type().hash_code() == typeid(bool).hash_code() && if (!(ips[0]->type().hash_code() == typeid(bool).hash_code() && // NOLINT
ips[0]->numel() == 1)) { ips[0]->numel() == 1)) {
PADDLE_THROW( PADDLE_THROW(
"condition input's data type should be bool, " "condition input's data type should be bool, "
......
...@@ -15,8 +15,6 @@ limitations under the License. */ ...@@ -15,8 +15,6 @@ limitations under the License. */
#include "paddle/fluid/operators/expand_op.h" #include "paddle/fluid/operators/expand_op.h"
#include <vector> #include <vector>
#include <vector>
namespace paddle { namespace paddle {
namespace operators { namespace operators {
......
...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include <thread> #include <thread> // NOLINT
#include <vector> #include <vector>
#include "paddle/fluid/framework/executor.h" #include "paddle/fluid/framework/executor.h"
#include "paddle/fluid/framework/lod_tensor.h" #include "paddle/fluid/framework/lod_tensor.h"
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
// limitations under the License. // limitations under the License.
#include "paddle/fluid/operators/increment_op.h" #include "paddle/fluid/operators/increment_op.h"
#include <string>
namespace paddle { namespace paddle {
namespace operators { namespace operators {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册