Skip to content

Commit

Permalink
Merge pull request #748 from google/mytflmfixes
Browse files Browse the repository at this point in the history
My tflm fixes
  • Loading branch information
ShvetankPrakash committed Jan 9, 2023
2 parents 19e8432 + 5c857fa commit 42b47e9
Show file tree
Hide file tree
Showing 113 changed files with 4,162 additions and 2,936 deletions.
2 changes: 1 addition & 1 deletion conf/tflite-micro.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
370d7bb
3e7d66c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ limitations under the License.
#define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_INTEGER_OPS_FULLY_CONNECTED_H_

#include <cstdio>
#include <algorithm>

#include "tensorflow/lite/kernels/internal/common.h"
#include "tensorflow/lite/kernels/internal/portable_tensor_utils.h"
#include "tensorflow/lite/kernels/internal/reference/integer_ops/fully_connected_accel.h"

namespace tflite {
Expand Down Expand Up @@ -93,6 +95,20 @@ inline void FullyConnected(
}
}

inline void FullyConnectedWithPackedInt4Weights(
const FullyConnectedParams& params, const RuntimeShape& input_shape,
const int8_t* input_data, const RuntimeShape& filter_shape,
const int8_t* filter_data, int8_t* unpacked_filter_data,
const RuntimeShape& bias_shape, const int32_t* bias_data,
const RuntimeShape& output_shape, int8_t* output_data) {
TFLITE_DCHECK_NE(unpacked_filter_data, nullptr);
tflite::tensor_utils::UnpackDenseInt4IntoInt8(
filter_data, filter_shape.FlatSize(), unpacked_filter_data);
FullyConnected(params, input_shape, input_data, filter_shape,
unpacked_filter_data, bias_shape, bias_data, output_shape,
output_data);
}

inline void FullyConnected(
const FullyConnectedParams& params, const RuntimeShape& input_shape,
const int16_t* input_data, const RuntimeShape& filter_shape,
Expand Down
2 changes: 2 additions & 0 deletions proj/proj.mk
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ TFLM_COPY_SRC_DIRS := \
tensorflow/lite \
tensorflow/lite/c \
tensorflow/lite/core/api \
tensorflow/lite/core/c \
tensorflow/lite/kernels \
tensorflow/lite/kernels/internal \
tensorflow/lite/kernels/internal/optimized \
Expand All @@ -143,6 +144,7 @@ TFLM_COPY_SRC_DIRS := \
tensorflow/lite/micro/kernels \
tensorflow/lite/micro/memory_planner \
tensorflow/lite/micro/arena_allocator \
tensorflow/lite/micro/tflite_bridge \
tensorflow/lite/schema

TFLM_FIND_PARAMS := \
Expand Down
2 changes: 1 addition & 1 deletion third_party/tflite-micro/tensorflow/lite/builtin_op_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ limitations under the License.
#ifndef TENSORFLOW_LITE_BUILTIN_OP_DATA_H_
#define TENSORFLOW_LITE_BUILTIN_OP_DATA_H_

#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/core/c/builtin_op_data.h"

#endif // TENSORFLOW_LITE_BUILTIN_OP_DATA_H_

0 comments on commit 42b47e9

Please sign in to comment.