def input_func(): inputs = prepare_chainerx_inputs( 1, config1, True) + prepare_chainerx_inputs( 1, config2, True) result = func(*inputs) result.grad = chainerx.ones_like(result) return result
def test_ones_like_with_device(shape, device): t = chainerx.empty((2,), 'float32') a = chainerx.ones_like(t, device) b = chainerx.ones_like(t) array_utils.check_device(a, device) chainerx.testing.assert_array_equal_ex(a, b)
def test_ones_like_with_device(shape, device): t = chainerx.empty((2,), 'float32') a = chainerx.ones_like(t, device) b = chainerx.ones_like(t) array_utils.check_device(a, device) chainerx.testing.assert_array_equal_ex(a, b)
def input_func(): inputs = prepare_chainerx_inputs(num_input, tensor_config, True) result = func(*inputs) result.grad = chainerx.ones_like(result) return result