Skip to content

Commit

Permalink
remove frontend.tflite_flatbuffer module and update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dboyliao committed May 6, 2020
1 parent 18f0460 commit cae7806
Show file tree
Hide file tree
Showing 112 changed files with 15 additions and 3,945 deletions.
29 changes: 15 additions & 14 deletions utensor_cgen/frontend/tflite.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
from utensor_cgen.ir.base import OperationInfo, TensorInfo, uTensorGraph
from utensor_cgen.ir.converter import (AttrValueConverter,
GenericTensorConverterMixin)
from utensor_cgen.utils import topologic_order_graph

from .tflite_flatbuffer.ActivationFunctionType import ActivationFunctionType
from .tflite_flatbuffer.BuiltinOperator import BuiltinOperator
from .tflite_flatbuffer.CustomOptionsFormat import CustomOptionsFormat
from .tflite_flatbuffer.FullyConnectedOptionsWeightsFormat import \
from utensor_cgen.third_party.tflite.ActivationFunctionType import \
ActivationFunctionType
from utensor_cgen.third_party.tflite.BuiltinOperator import BuiltinOperator
from utensor_cgen.third_party.tflite.CustomOptionsFormat import \
CustomOptionsFormat
from utensor_cgen.third_party.tflite.FullyConnectedOptionsWeightsFormat import \
FullyConnectedOptionsWeightsFormat
from .tflite_flatbuffer.Model import Model
from utensor_cgen.third_party.tflite.Model import Model
from utensor_cgen.utils import topologic_order_graph

_CUSTOM_OPTION_FORMAT_MAP = {v: k for k, v in CustomOptionsFormat.__dict__.items()}

Expand All @@ -27,7 +28,7 @@ def class_option2str(obj, idx):
def fully_connected_op_data(op):
option_dict = {}
if op.CustomOptionsLength() < 1:
from .tflite_flatbuffer.FullyConnectedOptions import FullyConnectedOptions
from utensor_cgen.third_party.tflite.FullyConnectedOptions import FullyConnectedOptions

option = FullyConnectedOptions()
builtin_data = op.BuiltinOptions()
Expand All @@ -47,7 +48,7 @@ def fully_connected_op_data(op):
def depthwise_conv2d_op_data(op):
option_dict = {}
if op.CustomOptionsLength() < 1:
from .tflite_flatbuffer.DepthwiseConv2DOptions import DepthwiseConv2DOptions
from utensor_cgen.third_party.tflite.DepthwiseConv2DOptions import DepthwiseConv2DOptions

option = DepthwiseConv2DOptions()
builtin_data = op.BuiltinOptions()
Expand All @@ -72,7 +73,7 @@ def depthwise_conv2d_op_data(op):
def reshape_op_data(op):
option_dict = {}
if op.CustomOptionsLength() < 1:
from .tflite_flatbuffer.ReshapeOptions import ReshapeOptions
from utensor_cgen.third_party.tflite.ReshapeOptions import ReshapeOptions

option = ReshapeOptions()
builtin_data = op.BuiltinOptions()
Expand All @@ -88,7 +89,7 @@ def reshape_op_data(op):
def dequantize_op_data(op):
option_dict = {}
if op.CustomOptionsLength() < 1:
from .tflite_flatbuffer.DequantizeOptions import DequantizeOptions
from utensor_cgen.third_party.tflite.DequantizeOptions import DequantizeOptions

option = DequantizeOptions()
builtin_data = op.BuiltinOptions()
Expand All @@ -106,7 +107,7 @@ def dequantize_op_data(op):
def quantize_op_data(op):
option_dict = {}
if op.CustomOptionsLength() < 1:
from .tflite_flatbuffer.QuantizeOptions import QuantizeOptions
from utensor_cgen.third_party.tflite.QuantizeOptions import QuantizeOptions

option = QuantizeOptions()
builtin_data = op.BuiltinOptions()
Expand All @@ -124,7 +125,7 @@ def quantize_op_data(op):
def pool2d_op_data(op):
option_dict = {}
if op.CustomOptionsLength() < 1:
from .tflite_flatbuffer.Pool2DOptions import Pool2DOptions
from utensor_cgen.third_party.tflite.Pool2DOptions import Pool2DOptions

option = Pool2DOptions()
builtin_data = op.BuiltinOptions()
Expand All @@ -147,7 +148,7 @@ def pool2d_op_data(op):
def argmax_op_data(op):
option_dict = {}
if op.CustomOptionsLength() < 1:
from .tflite_flatbuffer.ArgMaxOptions import ArgMaxOptions
from utensor_cgen.third_party.tflite.ArgMaxOptions import ArgMaxOptions

option = ArgMaxOptions()
builtin_data = op.BuiltinOptions()
Expand Down
22 changes: 0 additions & 22 deletions utensor_cgen/frontend/tflite_flatbuffer/AbsOptions.py

This file was deleted.

12 changes: 0 additions & 12 deletions utensor_cgen/frontend/tflite_flatbuffer/ActivationFunctionType.py

This file was deleted.

22 changes: 0 additions & 22 deletions utensor_cgen/frontend/tflite_flatbuffer/AddNOptions.py

This file was deleted.

30 changes: 0 additions & 30 deletions utensor_cgen/frontend/tflite_flatbuffer/AddOptions.py

This file was deleted.

30 changes: 0 additions & 30 deletions utensor_cgen/frontend/tflite_flatbuffer/ArgMaxOptions.py

This file was deleted.

30 changes: 0 additions & 30 deletions utensor_cgen/frontend/tflite_flatbuffer/ArgMinOptions.py

This file was deleted.

22 changes: 0 additions & 22 deletions utensor_cgen/frontend/tflite_flatbuffer/BatchToSpaceNDOptions.py

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit cae7806

Please sign in to comment.