| 623 | TF_DEVICELIST_METHOD(const char*, TF_DeviceListType, device_type().c_str(), |
| 624 | nullptr); |
| 625 | TF_DEVICELIST_METHOD(int64_t, TF_DeviceListMemoryBytes, memory_limit(), -1); |
| 626 | TF_DEVICELIST_METHOD(uint64_t, TF_DeviceListIncarnation, incarnation(), 0); |
| 627 | |
| 628 | #undef TF_DEVICELIST_METHOD |
| 629 | |
| 630 | } // end extern "C" |
| 631 | |
| 632 | // -------------------------------------------------------------------------- |
| 633 | // New Graph and Session API |
| 634 | |
| 635 | // Helper functions ----------------------------------------------------------- |
| 636 | |
| 637 | namespace { |
| 638 | |
| 639 | TF_Operation* ToOperation(Node* node) { |
| 640 | return static_cast<TF_Operation*>(static_cast<void*>(node)); |
| 641 | } |
| 642 | |
| 643 | string OutputName(const TF_Output& output) { |
| 644 | return StrCat(output.oper->node.name(), ":", output.index); |
| 645 | } |
| 646 | |
| 647 | const tensorflow::AttrValue* GetAttrValue(TF_Operation* oper, |
| 648 | const char* attr_name, |
| 649 | TF_Status* status) { |
| 650 | const tensorflow::AttrValue* attr = oper->node.attrs().Find(attr_name); |
| 651 | if (attr == nullptr) { |
| 652 | status->status = InvalidArgument("Operation '", oper->node.name(), |
| 653 | "' has no attr named '", attr_name, "'."); |
| 654 | } |
| 655 | return attr; |
| 656 | } |
| 657 | |
| 658 | TensorId ToTensorId(const TF_Output& output) { |
| 659 | return TensorId(output.oper->node.name(), output.index); |
| 660 | } |
| 661 | |
| 662 | #if !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD) |
| 663 | std::vector<tensorflow::Output> OutputsFromTFOutputs(TF_Output* tf_outputs, |
nothing calls this directly
no test coverage detected