| 1440 | } |
| 1441 | |
| 1442 | void TF_OperationGetAttrTensorShapeProto(TF_Operation* oper, |
| 1443 | const char* attr_name, |
| 1444 | TF_Buffer* value, TF_Status* status) { |
| 1445 | const auto* attr = GetAttrValue(oper, attr_name, status); |
| 1446 | if (TF_GetCode(status) != TF_OK) return; |
| 1447 | if (attr->value_case() != tensorflow::AttrValue::kShape) { |
| 1448 | status->status = |
| 1449 | InvalidArgument("Value for '", attr_name, "' is not a shape."); |
| 1450 | return; |
| 1451 | } |
| 1452 | status->status = MessageToBuffer(attr->shape(), value); |
| 1453 | } |
| 1454 | |
| 1455 | void TF_OperationGetAttrTensorShapeProtoList(TF_Operation* oper, |
| 1456 | const char* attr_name, |