| 1128 | } |
| 1129 | |
| 1130 | Status InferenceContext::Min(DimensionHandle first, DimensionOrConstant second, |
| 1131 | DimensionHandle* out) { |
| 1132 | const int64 first_value = Value(first); |
| 1133 | const int64 second_value = Value(second); |
| 1134 | if (first_value == 0) { |
| 1135 | *out = first; |
| 1136 | } else if (second_value == 0) { |
| 1137 | *out = MakeDim(second); |
| 1138 | } else if (first_value == kUnknownDim || second_value == kUnknownDim) { |
| 1139 | *out = UnknownDim(); |
| 1140 | } else { |
| 1141 | if (first_value <= second_value) { |
| 1142 | *out = first; |
| 1143 | } else { |
| 1144 | *out = MakeDim(second); |
| 1145 | } |
| 1146 | } |
| 1147 | return Status::OK(); |
| 1148 | } |
| 1149 | |
| 1150 | Status InferenceContext::Max(DimensionHandle first, DimensionOrConstant second, |
| 1151 | DimensionHandle* out) { |