Home | History | Annotate | Download | only in ragged

Lines Matching refs:lengths

43         RaggedTensor.from_tensor(dt, lengths=[1, 0, 3]), [[5], [], [6, 0, 0]])
52 RaggedTensor.from_tensor(dt_3d, lengths=([2, 0, 3], [1, 1, 2, 0, 1])),
110 'lengths': [1],
115 'lengths': [0],
120 'lengths': [0, 1, 2],
125 'lengths': [0, 0, 0],
130 'lengths': [2, 2],
135 'lengths': [7, 8], # lengths > ncols: truncated to ncols
140 'lengths': [-2, -1], # lengths < 0: treated as zero
146 'lengths': [0, 0],
151 'lengths': [1, 2],
156 'lengths': [2, 2],
229 'lengths': [2, 0, 2, 1],
264 'lengths': ([2, 2], [1, 2, 2, 1]),
273 'lengths': [[2, 2], [1, 2, 2, 1]],
290 'lengths': ([2, 2], [2, 2, 2, 2], [1, 2, 0, 1, 2, 1, 2, 0]),
299 'lengths': [[2, 2], [2, 2, 2, 2], [1, 2, 0, 1, 2, 1, 2, 0]],
309 lengths=None,
315 rt = RaggedTensor.from_tensor(dt, lengths, padding, ragged_rank)
317 rt = RaggedTensor.from_tensor(dt, lengths, padding)
340 # With no padding or lengths
404 # With lengths
407 'lengths': [],
412 'lengths': [],
417 'lengths': [0, 0, 0],
422 'lengths': [2, 3, 4], # lengths > ncols: truncated to ncols
427 'lengths': [],
432 'lengths': [0, 0],
437 'lengths': [0, 0],
441 def testEmpty(self, dt_shape, expected, lengths=None, padding=None):
443 rt = RaggedTensor.from_tensor(dt, lengths, padding)
452 'lengths': [0],
454 'error': (ValueError, 'Specify lengths or padding, but not both')
458 'lengths': [0.5],
459 'error': (TypeError, 'lengths must be an integer tensor')
463 'lengths': [[1], [1]],
499 lengths=None,
505 lengths, padding, ragged_rank)