Skip to content

Commit

Permalink
Fix CPPLint issues in tuple.h (#9670)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavarora committed Apr 6, 2018
1 parent 3d3e5ae commit b5b7ea1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions paddle/fluid/framework/tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,25 @@ class Tuple {
public:
using ElementVars = std::vector<ElementVar>;

Tuple(std::vector<ElementVar>& var, std::vector<VarDesc>& var_desc)
Tuple(const std::vector<ElementVar>& var,
const std::vector<VarDesc>& var_desc)
: var_(var), var_desc_(var_desc) {}
Tuple(std::vector<ElementVar>& var) : var_(var) {}
explicit Tuple(std::vector<ElementVar>& var) : var_(var) {}

ElementVar get(int idx) const { return var_[idx]; };
ElementVar get(int idx) const { return var_[idx]; }

ElementVar& get(int idx) { return var_[idx]; };
ElementVar& get(int idx) { return var_[idx]; }

bool isSameType(Tuple& t) const;
bool isSameType(const Tuple& t) const;

size_t getSize() const { return var_.size(); };
size_t getSize() const { return var_.size(); }

private:
ElementVars var_;
std::vector<VarDesc> var_desc_;
};

bool Tuple::isSameType(Tuple& t) const {
bool Tuple::isSameType(const Tuple& t) const {
size_t tuple_size = getSize();
if (tuple_size != t.getSize()) {
return false;
Expand Down

0 comments on commit b5b7ea1

Please sign in to comment.