| 102 | } |
| 103 | |
| 104 | Status NewSessionGroup(const SessionOptions& options, |
| 105 | SessionGroup** out_session_group, |
| 106 | const SessionGroupMetadata& metadata) { |
| 107 | SessionFactory* factory; |
| 108 | Status s = SessionFactory::GetFactory(options, &factory); |
| 109 | if (!s.ok()) { |
| 110 | *out_session_group = nullptr; |
| 111 | LOG(ERROR) << s; |
| 112 | return s; |
| 113 | } |
| 114 | // Starts exporting metrics through a platform-specific monitoring API (if |
| 115 | // provided). For builds using "tensorflow/core/platform/default", this is |
| 116 | // currently a no-op. |
| 117 | session_created->GetCell()->Set(true); |
| 118 | monitoring::StartExporter(); |
| 119 | s = factory->NewSessionGroup(options, out_session_group, metadata); |
| 120 | if (!s.ok()) { |
| 121 | *out_session_group = nullptr; |
| 122 | } |
| 123 | return s; |
| 124 | } |
| 125 | |
| 126 | Status Reset(const SessionOptions& options, |
| 127 | const std::vector<string>& containers) { |