Pop an example from the given rpc server. This op intentionally fails when the server is unavailable. This is because the RPC op silently fails to recover when the server recovers. Args: address (string): Server created by `push_examples`. timeout_in_ms (in): How long we are willing
(address, timeout_in_ms=10 * 1000 * 60)
| 106 | |
| 107 | |
| 108 | def pop_example(address, timeout_in_ms=10 * 1000 * 60): |
| 109 | """Pop an example from the given rpc server. |
| 110 | |
| 111 | This op intentionally fails when the server is unavailable. This is because |
| 112 | the RPC op silently fails to recover when the server recovers. |
| 113 | |
| 114 | Args: |
| 115 | address (string): Server created by `push_examples`. |
| 116 | timeout_in_ms (in): How long we are willing to wait for the next example. |
| 117 | |
| 118 | Returns: |
| 119 | response (Tensor<string> []): Serialized tf.Example. |
| 120 | """ |
| 121 | result = _make_rpc_op(address, timeout_in_ms) |
| 122 | assert_ok = tf.assert_equal( |
| 123 | x=result.status_code, |
| 124 | y=tf.errors.OK, |
| 125 | data=["RPC call failed", result.status_message]) |
| 126 | with tf.control_dependencies([assert_ok]): |
| 127 | return tf.identity(result.response) |
| 128 | |
| 129 | |
| 130 | def dataset_from_preprocessors(preprocessing_servers, |
nothing calls this directly
no test coverage detected
searching dependent graphs…