def setUp(self): # Since `set_device` is global, set `set_device` in `setUp` rather than # `__init__` to avoid using an error device set by another test case. place = paddle.set_device(self.place) paddle.disable_static(place) rnn1 = SimpleRNN( 16, 32, 2, time_major=self.time_major, direction=self.direction) rnn2 = paddle.nn.SimpleRNN( 16, 32, 2, time_major=self.time_major, direction=self.direction) convert_params_for_net(rnn1, rnn2) self.rnn1 = rnn1 self.rnn2 = rnn2
def setUp(self): paddle.disable_static(self.place) rnn1 = SimpleRNN(16, 32, 2, time_major=self.time_major, direction=self.direction) rnn2 = paddle.nn.SimpleRNN(16, 32, 2, time_major=self.time_major, direction=self.direction) convert_params_for_net(rnn1, rnn2) self.rnn1 = rnn1 self.rnn2 = rnn2