MCPcopy Create free account
hub / github.com/pytorch/pytorch / _rectify_apply_inputs

Method _rectify_apply_inputs

caffe2/python/rnn_cell.py:164–183  ·  view source on GitHub ↗

Before applying a scope we make sure that all external blob names are converted to blob reference. So further scoping doesn't affect them

(
            self, input_t, seq_lengths, states, timestep, extra_inputs)

Source from the content-addressed store, hash-verified

162 return self.apply_override(model, *args)
163
164 def _rectify_apply_inputs(
165 self, input_t, seq_lengths, states, timestep, extra_inputs):
166 '''
167 Before applying a scope we make sure that all external blob names
168 are converted to blob reference. So further scoping doesn't affect them
169 '''
170
171 input_t, seq_lengths, timestep = _RectifyNames(
172 [input_t, seq_lengths, timestep])
173 states = _RectifyNames(states)
174 if extra_inputs:
175 extra_input_names, extra_input_sizes = zip(*extra_inputs)
176 extra_inputs = _RectifyNames(extra_input_names)
177 extra_inputs = zip(extra_input_names, extra_input_sizes)
178
179 arg_names = inspect.getargspec(self.apply_override).args
180 rectified = [input_t, seq_lengths, states, timestep]
181 if 'extra_inputs' in arg_names:
182 rectified.append(extra_inputs)
183 return rectified
184
185
186 def apply_override(

Callers 2

_applyMethod · 0.95
_applyMethod · 0.80

Calls 2

_RectifyNamesFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected