def gather_grads(link):
    'Put together all gradient arrays and make a single array\n\n    Args:\n        link (chainer.link.Link): Target link object.\n    Return:\n        cupy.ndarray\n    '
    if (link.xp is numpy):
        raise RuntimeError('gather_grads works only on GPU.')
    return _gather(link, 'grad')
Put together all gradient arrays and make a single array

Args:
    link (chainer.link.Link): Target link object.
Return:
    cupy.ndarray
def gather_grads(link):
    'Put together all gradient arrays and make a single array\n\n    Args:\n        link (chainer.link.Link): Target link object.\n    Return:\n        cupy.ndarray\n    '
    if (link.xp is numpy):
        raise RuntimeError('gather_grads works only on GPU.')
    return _gather(link, 'grad')