MCPcopy Create free account
hub / github.com/apache/singa / repeat

Function repeat

python/singa/tensor.py:1472–1486  ·  view source on GitHub ↗

Return the repeated tensor Args: t(tensor): the tensor to be repeated repeats(int or a sequence): the number that the tensor need to repeat for axis (int):the axis to do repeat If it is None, then the repeated tensor will be flattened.If it isn't None

(t, repeats, axis=None)

Source from the content-addressed store, hash-verified

1470
1471
1472def repeat(t, repeats, axis=None):
1473 '''Return the repeated tensor
1474
1475 Args:
1476 t(tensor): the tensor to be repeated
1477 repeats(int or a sequence): the number that the tensor need to repeat for
1478 axis (int):the axis to do repeat
1479 If it is None, then the repeated tensor will be flattened.If it isn't None,
1480 the repeats could be sequence, but it's size should match the axis's shape
1481
1482 Returns:
1483 the tensor which has been repeated
1484 '''
1485 ret = t.repeat(repeats, axis)
1486 return ret
1487
1488
1489def tensordot(A, B, axes=2):

Callers 1

einsumFunction · 0.70

Calls 1

repeatMethod · 0.45

Tested by

no test coverage detected