Skip to content

Commit

Permalink
respond to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Brookhart committed Sep 25, 2020
1 parent 664a055 commit 795422f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion python/tvm/autotvm/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def decode(row, protocol="json"):
tgt, task_name, task_args, task_kwargs = row["input"]
tgt = str(tgt)
if "-target" in tgt:
# logger.warning('"-target" is deprecated, use "-mtriple" instead.')
logger.warning('"-target" is deprecated, use "-mtriple" instead.')
tgt = tgt.replace("-target", "-mtriple")
tgt = Target(str(tgt))

Expand Down
27 changes: 8 additions & 19 deletions python/tvm/relay/frontend/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# pylint: disable=invalid-name, import-self, len-as-condition, unused-argument, too-many-lines
# pylint: disable=import-outside-toplevel
"""ONNX: Open Neural Network Exchange frontend for Relay."""
import logging
import numpy as np
import tvm
from tvm.ir import IRModule
Expand All @@ -34,8 +33,6 @@
from .common import infer_type, get_name


logger = logging.getLogger("onnx_frontend")

__all__ = ["from_onnx"]


Expand Down Expand Up @@ -257,11 +254,8 @@ def _impl_v1(cls, inputs, attr, params):
pad_tuple = tuple([val for pair in zip(*pad_tuple) for val in pair])
attr["pads"] = pad_tuple
else:
warning = (
"Performing dynamic autopadding on Pool. "
+ "Pool kernels don't currently support dynamic shapes."
)
logger.warning(warning)
# Warning: Pool does not yet support dynamic shapes,
# one will need to run dynamic_to_static on this model after import
data = autopad(data, attr["strides"], attr["kernel_shape"], [1] * ndim, ndim)
elif attr["auto_pad"] == "VALID":
attr["pads"] = tuple([0 for i in range(ndim - 2)])
Expand Down Expand Up @@ -386,7 +380,8 @@ def _impl_v1(cls, inputs, attr, params):
"Performing dynamic autopadding on Conv. "
+ "Conv kernels don't currently support dynamic shapes."
)
logger.warning(warning)
# Warning: Convolution does not yet support dynamic shapes,
# one will need to run dynamic_to_static on this model after import
data = autopad(data, attr["strides"], attr["kernel_shape"], attr["dilations"], ndim)
elif attr["auto_pad"] == "VALID":
attr["pads"] = tuple([0 for i in range(ndim - 2)])
Expand Down Expand Up @@ -442,11 +437,8 @@ def _impl_v1(cls, inputs, attr, params):
if "auto_pad" in attr:
attr["auto_pad"] = attr["auto_pad"].decode("utf-8")
if attr["auto_pad"] in ("SAME_UPPER", "SAME_LOWER"):
warning = (
"Performing dynamic autopadding on ConvTranspose. "
+ "ConvTranspose kernels don't currently support dynamic shapes."
)
logger.warning(warning)
# Warning: Convolution does not yet support dynamic shapes,
# one will need to run dynamic_to_static on this model after import
data = autopad(
data,
attr["strides"],
Expand Down Expand Up @@ -616,11 +608,8 @@ def _impl_v1(cls, inputs, attr, params):
if "auto_pad" in attr:
attr["auto_pad"] = attr["auto_pad"].decode("utf-8")
if attr["auto_pad"] in ("SAME_UPPER", "SAME_LOWER"):
warning = (
"Performing dynamic autopadding on LpPool. "
+ "LpPool kernels don't currently support dynamic shapes."
)
logger.warning(warning)
# Warning: LpPool does not yet support dynamic shapes,
# one will need to run dynamic_to_static on this model after import
data = autopad(data, attr["strides"], attr["kernel_shape"], [1] * ndim, ndim)
elif attr["auto_pad"] == "VALID":
attr["pads"] = tuple([0 for i in range(ndim - 2)])
Expand Down

0 comments on commit 795422f

Please sign in to comment.