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

Function write_tensor

tensorflow/lite/testing/generate_examples_lib.py:182–186  ·  view source on GitHub ↗

Write tensor in file format supported by TFLITE example.

(fp, x)

Source from the content-addressed store, hash-verified

180 """
181
182 def write_tensor(fp, x):
183 """Write tensor in file format supported by TFLITE example."""
184 fp.write("dtype,%s\n" % x.dtype)
185 fp.write("shape," + ",".join(map(str, x.shape)) + "\n")
186 fp.write("values," + format_result(x) + "\n")
187
188 fp.write("test_cases,%d\n" % len(examples))
189 for example in examples:

Callers 1

write_examplesFunction · 0.85

Calls 3

format_resultFunction · 0.85
writeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected