MCPcopy
hub / github.com/tensorflow/models / write

Method write

orbit/actions/new_best_metric.py:213–222  ·  view source on GitHub ↗

Writes the value, updating the backing store if one was provided.

(self, value)

Source from the content-addressed store, hash-verified

211 return self._value
212
213 def write(self, value):
214 """Writes the value, updating the backing store if one was provided."""
215 self._value = value
216 if self._filename is not None and self._write_value:
217 # To achieve atomic writes, we first write to a temporary file, and then
218 # rename it to `self._filename`.
219 tmp_filename = f'{self._filename}.tmp.{uuid.uuid4().hex}'
220 with tf.io.gfile.GFile(tmp_filename, 'w') as f:
221 json.dump(self._value, f)
222 tf.io.gfile.rename(tmp_filename, self._filename, overwrite=True)

Callers 15

__init__Method · 0.95
write_temp_fileMethod · 0.80
test_export_tfhubMethod · 0.80
custom_mainFunction · 0.80
write_txt_summaryFunction · 0.80
generate_annotation_fileFunction · 0.80
create_tfrecordsFunction · 0.80
write_predictionsFunction · 0.80
process_featureMethod · 0.80
_generate_fileFunction · 0.80

Calls

no outgoing calls

Tested by 15

write_temp_fileMethod · 0.64
test_export_tfhubMethod · 0.64
_generate_fileFunction · 0.64
_create_temp_fileMethod · 0.64
_init_subtokenizerMethod · 0.64
setUpMethod · 0.64
test_export_modelMethod · 0.64
test_load_labelsMethod · 0.64
test_export_tfliteMethod · 0.64
_dump_tfliteFunction · 0.64
_create_fake_datasetFunction · 0.64