MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TF_DEVICELIST_METHOD

Function TF_DEVICELIST_METHOD

tensorflow/c/c_api.cc:625–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623TF_DEVICELIST_METHOD(const char*, TF_DeviceListType, device_type().c_str(),
624 nullptr);
625TF_DEVICELIST_METHOD(int64_t, TF_DeviceListMemoryBytes, memory_limit(), -1);
626TF_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
637namespace {
638
639TF_Operation* ToOperation(Node* node) {
640 return static_cast<TF_Operation*>(static_cast<void*>(node));
641}
642
643string OutputName(const TF_Output& output) {
644 return StrCat(output.oper->node.name(), ":", output.index);
645}
646
647const 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
658TensorId 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)
663std::vector<tensorflow::Output> OutputsFromTFOutputs(TF_Output* tf_outputs,

Callers

nothing calls this directly

Calls 5

InvalidArgumentFunction · 0.85
nameMethod · 0.65
TensorIdClass · 0.50
FindMethod · 0.45
attrsMethod · 0.45

Tested by

no test coverage detected