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

Function PackLargeInput

tensorflow/compiler/xla/client/lib/quantize_test.cc:54–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53template <typename NativeT>
54Array2D<uint32> PackLargeInput(Array2D<NativeT> &input) {
55 const int64 size_per_pack = sizeof(uint32) / sizeof(NativeT);
56 int64 width = input.width();
57
58 int64 padded_output_width = CeilOfRatio(width, size_per_pack);
59
60 Array2D<uint32> pack_input(input.height(), padded_output_width);
61
62 for (int h = 0; h < input.height(); h++) {
63 std::vector<NativeT> input_row;
64 for (int w = 0; w < width; w++) {
65 input_row.push_back(input({h, w}));
66 }
67
68 auto pack_input_vec = PackToUint32<uint8>(input_row);
69
70 for (int w = 0; w < padded_output_width; w++) {
71 pack_input(h, w) = pack_input_vec[w];
72 }
73 }
74
75 return pack_input;
76}
77
78template <typename NativeT>
79Array2D<bfloat16> GenerateLargeSizeMinCombinedOutput(

Callers

nothing calls this directly

Calls 4

CeilOfRatioFunction · 0.50
widthMethod · 0.45
heightMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected