Returns true iff partial is true and val is < 0. REQUIRES: val < kMaxRep16 REQUIRES: partial || val >= 0
| 176 | // REQUIRES: val < kMaxRep16 |
| 177 | // REQUIRES: partial || val >= 0 |
| 178 | static inline bool Set16(bool partial, uint16* dst, int dim, int64 val) { |
| 179 | if (partial) { |
| 180 | if (val < 0) { |
| 181 | dst[dim] = std::numeric_limits<uint16>::max(); |
| 182 | return true; |
| 183 | } |
| 184 | } else { |
| 185 | CHECK_GE(val, 0); |
| 186 | } |
| 187 | dst[dim] = val; |
| 188 | return false; |
| 189 | } |
| 190 | |
| 191 | template <class Shape> |
| 192 | Status TensorShapeBase<Shape>::InitDims(gtl::ArraySlice<int64> dim_sizes) { |