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

Fix more CPPLint errors (#10069)

上级 bb4b9af7
......@@ -29,10 +29,10 @@ namespace paddle {
namespace operators {
void SetReceiveStatus(const platform::Place &dev_place,
framework::Variable &status_var, bool status) {
framework::Variable *status_var, bool status) {
auto cpu = platform::CPUPlace();
auto status_tensor =
status_var.GetMutable<framework::LoDTensor>()->mutable_data<bool>({1},
status_var->GetMutable<framework::LoDTensor>()->mutable_data<bool>({1},
cpu);
status_tensor[0] = status;
}
......@@ -66,7 +66,7 @@ class ChannelRecvOp : public framework::OperatorBase {
bool ok = concurrency::ChannelReceive(ch, output_var);
// 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 {
if (!(ips.size() == 1UL && ips[0]->IsInitialized())) {
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)) {
PADDLE_THROW(
"condition input's data type should be bool, "
......
......@@ -15,8 +15,6 @@ limitations under the License. */
#include "paddle/fluid/operators/expand_op.h"
#include <vector>
#include <vector>
namespace paddle {
namespace operators {
......
......@@ -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
limitations under the License. */
#include <thread>
#include <thread> // NOLINT
#include <vector>
#include "paddle/fluid/framework/executor.h"
#include "paddle/fluid/framework/lod_tensor.h"
......
......@@ -13,6 +13,7 @@
// limitations under the License.
#include "paddle/fluid/operators/increment_op.h"
#include <string>
namespace paddle {
namespace operators {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册