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

Function main

serving/processor/tests/flatbuf_test/python/perf.py:29–478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 return ''.join(sa)
28
29def main():
30 # prepare data -------------------------
31
32 DEBUG = False
33 TESTING_COUNT = 100
34
35 float_count = 10
36 int64_count = 10
37 double_count = 10
38 int_count = 10
39 str_count = 10
40 dim0 = 2
41 dim1 = 1000
42 string_content_len = 8
43
44 total_count = float_count + \
45 int64_count + \
46 double_count + \
47 int_count + \
48 str_count
49
50 # signature name
51 signature_name = "default_serving"
52 # input names
53 input_names = []
54 for i in range(0, total_count):
55 input_names.append("input_name_" + str(i))
56 # data types
57 data_types = []
58 for i in range(0, total_count):
59 data_types.append(i)
60 # shapes
61 shapes = []
62 for i in range(0, total_count):
63 each_shape = []
64 each_shape.append(dim0)
65 each_shape.append(dim1)
66 shapes.append(each_shape)
67 # contents
68
69 # --- float ----
70 contents = []
71 start_num = 1.22341
72 incr_step = 0.67176
73 each_contents = []
74 each_content = array.array('f')
75 for i in range(dim0):
76 for j in range(dim1):
77 each_content.append(start_num)
78 start_num = start_num + incr_step
79 each_content = np.array(each_content, dtype=np.float32)
80 for i in range(float_count):
81 each_contents.append(deepcopy(each_content))
82 each_contents[i][0] = float(i)
83 contents.append(each_contents[i])
84
85 # --- int64 ----
86 i64_contents = []

Callers 1

perf.pyFile · 0.70

Calls 15

add_fetchMethod · 0.95
add_feedMethod · 0.95
to_stringMethod · 0.95
TFRequestClass · 0.90
str_randFunction · 0.85
timeMethod · 0.80
BuilderMethod · 0.80
EndVectorMethod · 0.80
rangeFunction · 0.50
appendMethod · 0.45
FinishMethod · 0.45
OutputMethod · 0.45

Tested by

no test coverage detected