Skip to content

Commit 54dd8d5

Browse files
author
Matthew Brookhart
committed
respond to review comments
1 parent 664a055 commit 54dd8d5

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

python/tvm/autotvm/record.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def decode(row, protocol="json"):
152152
tgt, task_name, task_args, task_kwargs = row["input"]
153153
tgt = str(tgt)
154154
if "-target" in tgt:
155-
# logger.warning('"-target" is deprecated, use "-mtriple" instead.')
155+
logger.warning('"-target" is deprecated, use "-mtriple" instead.')
156156
tgt = tgt.replace("-target", "-mtriple")
157157
tgt = Target(str(tgt))
158158

python/tvm/relay/frontend/onnx.py

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# pylint: disable=invalid-name, import-self, len-as-condition, unused-argument, too-many-lines
1818
# pylint: disable=import-outside-toplevel
1919
"""ONNX: Open Neural Network Exchange frontend for Relay."""
20-
import logging
2120
import numpy as np
2221
import tvm
2322
from tvm.ir import IRModule
@@ -34,8 +33,6 @@
3433
from .common import infer_type, get_name
3534

3635

37-
logger = logging.getLogger("onnx_frontend")
38-
3936
__all__ = ["from_onnx"]
4037

4138

@@ -257,11 +254,8 @@ def _impl_v1(cls, inputs, attr, params):
257254
pad_tuple = tuple([val for pair in zip(*pad_tuple) for val in pair])
258255
attr["pads"] = pad_tuple
259256
else:
260-
warning = (
261-
"Performing dynamic autopadding on Pool. "
262-
+ "Pool kernels don't currently support dynamic shapes."
263-
)
264-
logger.warning(warning)
257+
# Warning: Pool does not yet support dynamic shapes,
258+
# one will need to run dynamic_to_static on this model after import
265259
data = autopad(data, attr["strides"], attr["kernel_shape"], [1] * ndim, ndim)
266260
elif attr["auto_pad"] == "VALID":
267261
attr["pads"] = tuple([0 for i in range(ndim - 2)])
@@ -382,11 +376,8 @@ def _impl_v1(cls, inputs, attr, params):
382376
if "auto_pad" in attr:
383377
attr["auto_pad"] = attr["auto_pad"].decode("utf-8")
384378
if attr["auto_pad"] in ("SAME_UPPER", "SAME_LOWER"):
385-
warning = (
386-
"Performing dynamic autopadding on Conv. "
387-
+ "Conv kernels don't currently support dynamic shapes."
388-
)
389-
logger.warning(warning)
379+
# Warning: Convolution does not yet support dynamic shapes,
380+
# one will need to run dynamic_to_static on this model after import
390381
data = autopad(data, attr["strides"], attr["kernel_shape"], attr["dilations"], ndim)
391382
elif attr["auto_pad"] == "VALID":
392383
attr["pads"] = tuple([0 for i in range(ndim - 2)])
@@ -442,11 +433,8 @@ def _impl_v1(cls, inputs, attr, params):
442433
if "auto_pad" in attr:
443434
attr["auto_pad"] = attr["auto_pad"].decode("utf-8")
444435
if attr["auto_pad"] in ("SAME_UPPER", "SAME_LOWER"):
445-
warning = (
446-
"Performing dynamic autopadding on ConvTranspose. "
447-
+ "ConvTranspose kernels don't currently support dynamic shapes."
448-
)
449-
logger.warning(warning)
436+
# Warning: Convolution does not yet support dynamic shapes,
437+
# one will need to run dynamic_to_static on this model after import
450438
data = autopad(
451439
data,
452440
attr["strides"],
@@ -616,11 +604,8 @@ def _impl_v1(cls, inputs, attr, params):
616604
if "auto_pad" in attr:
617605
attr["auto_pad"] = attr["auto_pad"].decode("utf-8")
618606
if attr["auto_pad"] in ("SAME_UPPER", "SAME_LOWER"):
619-
warning = (
620-
"Performing dynamic autopadding on LpPool. "
621-
+ "LpPool kernels don't currently support dynamic shapes."
622-
)
623-
logger.warning(warning)
607+
# Warning: LpPool does not yet support dynamic shapes,
608+
# one will need to run dynamic_to_static on this model after import
624609
data = autopad(data, attr["strides"], attr["kernel_shape"], [1] * ndim, ndim)
625610
elif attr["auto_pad"] == "VALID":
626611
attr["pads"] = tuple([0 for i in range(ndim - 2)])

0 commit comments

Comments
 (0)