From 4c96b8a14db09d4f84c9e5ba9eeba75b63f892d6 Mon Sep 17 00:00:00 2001 From: Pingtian Date: Thu, 14 Feb 2019 20:21:29 -0800 Subject: [PATCH] rename to dynamic_unroll. --- 3rdparty/mkldnn | 2 +- 3rdparty/mshadow | 2 +- 3rdparty/onnx-tensorrt | 2 +- 3rdparty/tvm | 2 +- python/mxnet/gluon/contrib/rnn/rnn_cell.py | 10 +++++----- tests/python/unittest/test_gluon_contrib.py | 5 +++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/3rdparty/mkldnn b/3rdparty/mkldnn index a7c5f53832ac..0e7ca738866d 160000 --- a/3rdparty/mkldnn +++ b/3rdparty/mkldnn @@ -1 +1 @@ -Subproject commit a7c5f53832acabade6e5086e72c960adedb3c38a +Subproject commit 0e7ca738866d22cc700aa33b8de120b938f910d0 diff --git a/3rdparty/mshadow b/3rdparty/mshadow index 3dc80815d965..463c0dffe3ea 160000 --- a/3rdparty/mshadow +++ b/3rdparty/mshadow @@ -1 +1 @@ -Subproject commit 3dc80815d965b56b9a975dc27229361955bf66fe +Subproject commit 463c0dffe3eae8c39caf7989c85b7244823df27e diff --git a/3rdparty/onnx-tensorrt b/3rdparty/onnx-tensorrt index f1c7aa63d88d..3d8ee049970e 160000 --- a/3rdparty/onnx-tensorrt +++ b/3rdparty/onnx-tensorrt @@ -1 +1 @@ -Subproject commit f1c7aa63d88d8d8ef70490f2ebb6b33f7450218b +Subproject commit 3d8ee049970e81ff4935cc7f36b653c0b27bcbbc diff --git a/3rdparty/tvm b/3rdparty/tvm index 0f053c82a747..290226e1c9ad 160000 --- a/3rdparty/tvm +++ b/3rdparty/tvm @@ -1 +1 @@ -Subproject commit 0f053c82a747b4dcdf49570ec87c17e0067b7439 +Subproject commit 290226e1c9adbb3e598f9ed9184018df1c12be33 diff --git a/python/mxnet/gluon/contrib/rnn/rnn_cell.py b/python/mxnet/gluon/contrib/rnn/rnn_cell.py index 7ae8bfa71e26..3bd8e7810978 100644 --- a/python/mxnet/gluon/contrib/rnn/rnn_cell.py +++ b/python/mxnet/gluon/contrib/rnn/rnn_cell.py @@ -323,8 +323,8 @@ def hybrid_forward(self, F, inputs, states, i2h_weight, # pylint: enable= arguments-differ -def unroll(cell, inputs, begin_state, drop_inputs=0, drop_outputs=0, - layout='TNC', valid_length=None): +def dynamic_unroll(cell, inputs, begin_state, drop_inputs=0, drop_outputs=0, + layout='TNC', valid_length=None): """Unrolls an RNN cell across time steps. Currently, 'TNC' is a preferred layout. unroll on the input of this layout @@ -376,9 +376,9 @@ def unroll(cell, inputs, begin_state, drop_inputs=0, drop_outputs=0, >>> state_shape = (batch_size, input_size) >>> states = [mx.nd.normal(loc=0, scale=1, shape=state_shape) for i in range(2)] >>> valid_length = mx.nd.array([2, 3]) - >>> output, states = mx.gluon.contrib.rnn.rnn_cell.unroll(cell, rnn_data, states, - valid_length=valid_length, - layout='TNC') + >>> output, states = mx.gluon.contrib.rnn.rnn_cell.dynamic_unroll(cell, rnn_data, states, + valid_length=valid_length, + layout='TNC') >>> print(output) [[[ 0.00767238 0.00023103 0.03973929 -0.00925503 -0.05660512] [ 0.00881535 0.05428379 -0.02493718 -0.01834097 0.02189514]] diff --git a/tests/python/unittest/test_gluon_contrib.py b/tests/python/unittest/test_gluon_contrib.py index b6df8eeab927..1e0555900f17 100644 --- a/tests/python/unittest/test_gluon_contrib.py +++ b/tests/python/unittest/test_gluon_contrib.py @@ -324,8 +324,9 @@ def __init__(self, cell_type, hidden_size, layout, prefix=None, params=None): def hybrid_forward(self, F, inputs, states, valid_length): if isinstance(valid_length, list) and len(valid_length) == 0: valid_length = None - return contrib.rnn.rnn_cell.unroll(self.cell, inputs, states, - valid_length=valid_length, layout=self.layout) + return contrib.rnn.rnn_cell.dynamic_unroll(self.cell, inputs, states, + valid_length=valid_length, + layout=self.layout) def check_unroll(cell_type, num_states, layout): batch_size = 20