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

Method prepareData

serving/processor/tests/flatbuf_test/java/perf.java:63–138  ·  view source on GitHub ↗
(String sigName, String[] inputNames,
                                 int[] dataTypes, long[][] shapes,
                                 float[][] floatContent, long[][] longContent,
                                 double[][] doubleContent, int[][] intContent,
                                 String[][] stringContent, String[] fetchNames)

Source from the content-addressed store, hash-verified

61 }
62
63 public static void prepareData(String sigName, String[] inputNames,
64 int[] dataTypes, long[][] shapes,
65 float[][] floatContent, long[][] longContent,
66 double[][] doubleContent, int[][] intContent,
67 String[][] stringContent, String[] fetchNames) {
68 // sigName
69 sigName = "default_serving";
70
71 // fetch names/data types/shapes
72 String baseName =
73 "input_from_feature_columns/fm_10169_embedding/const";
74 for (int i = 0; i < TOTAL_COUNT; ++i) {
75 inputNames[i] = baseName + "_" + String.valueOf(i);
76
77 dataTypes[i] = i;
78
79 shapes[i][0] = DIM_0;
80 shapes[i][1] = DIM_1;
81 }
82
83 // float
84 for (int i = 0; i < FLOAT_COUNT; ++i) {
85 float startNum = (float)1.22341;
86 float incrStep = (float)0.67176;
87 for (int x = 0; x < DIM_0 * DIM_1; ++x) {
88 floatContent[i][x] = startNum;
89 startNum += incrStep;
90 }
91 }
92
93 // long
94 for (int i = 0; i < LONG_COUNT; ++i) {
95 long startNum = 223;
96 long incrStep = 76;
97 for (int x = 0; x < DIM_0 * DIM_1; ++x) {
98 longContent[i][x] = startNum;
99 startNum += incrStep;
100 }
101 }
102
103 // double
104 for (int i = 0; i < DOUBLE_COUNT; ++i) {
105 double startNum = 223.263763;
106 double incrStep = 76.265361;
107 for (int x = 0; x < DIM_0 * DIM_1; ++x) {
108 doubleContent[i][x] = startNum;
109 startNum += incrStep;
110 }
111 }
112
113 // int
114 for (int i = 0; i < INT_COUNT; ++i) {
115 int startNum = 300;
116 int incrStep = 1;
117 for (int x = 0; x < DIM_0 * DIM_1; ++x) {
118 intContent[i][x] = startNum;
119 startNum += incrStep;
120 }

Callers 1

mainMethod · 0.95

Calls 1

strRandMethod · 0.95

Tested by

no test coverage detected