MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / set_data

Method set_data

test/sequence/test_sequence_pool.py:262–272  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

260 return [[4, 1, 3, 5]]
261
262 def set_data(self):
263 self.op_type = 'sequence_pool'
264 x = np.random.uniform(0.1, 1, [13, 3, 17]).astype('float32')
265 lod = self.set_lod()
266 level = len(lod) - 1
267 self.inputs = {'X': (x, lod)}
268 offset = convert_to_offset(lod)
269
270 out = np.zeros((len(lod[level]), 3, 17)).astype('float32')
271 self.outputs = {'Out': out}
272 return x, lod, offset, out
273
274 def compute(self, x, offset, out):
275 self.attrs = {"pad_value": 0.0, 'pooltype': "AVERAGE"}

Callers

nothing calls this directly

Calls 4

set_lodMethod · 0.95
astypeMethod · 0.80
uniformMethod · 0.80
convert_to_offsetFunction · 0.70

Tested by

no test coverage detected