| 22 | namespace tensorflow { |
| 23 | |
| 24 | Status GetNodeAttr(const NodeDef& node_def, StringPiece attr_name, |
| 25 | Padding* value) { |
| 26 | string str_value; |
| 27 | TF_RETURN_IF_ERROR(GetNodeAttr(node_def, attr_name, &str_value)); |
| 28 | if (str_value == "SAME") { |
| 29 | *value = SAME; |
| 30 | } else if (str_value == "VALID") { |
| 31 | *value = VALID; |
| 32 | } else if (str_value == "EXPLICIT") { |
| 33 | *value = EXPLICIT; |
| 34 | } else { |
| 35 | return errors::NotFound(str_value, " is not an allowed padding type"); |
| 36 | } |
| 37 | return Status::OK(); |
| 38 | } |
| 39 | |
| 40 | Status CheckValidPadding(Padding padding_type, |
| 41 | const std::vector<int64>& explicit_paddings, |