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

Function repeat

examples/model_selection/Trails/singa_pkg_code/tensor.py:1437–1451  ·  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

1435
1436
1437def repeat(t, repeats, axis=None):
1438 '''Return the repeated tensor
1439
1440 Args:
1441 t(tensor): the tensor to be repeated
1442 repeats(int or a sequence): the number that the tensor need to repeat for
1443 axis (int):the axis to do repeat
1444 If it is None, then the repeated tensor will be flattened.If it isn't None,
1445 the repeats could be sequence, but it's size should match the axis's shape
1446
1447 Returns:
1448 the tensor which has been repeated
1449 '''
1450 ret = t.repeat(repeats, axis)
1451 return ret
1452
1453
1454def tensordot(A, B, axes=2):

Callers 1

einsumFunction · 0.70

Calls 1

repeatMethod · 0.45

Tested by

no test coverage detected