Skip to content

Commit 3315037

Browse files
authored
Fix missing spaces in some error messages. (#226)
1 parent e035850 commit 3315037

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

functorch/_src/eager_transforms.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _create_differentiable(inps, level=None):
3030
def create_differentiable(x):
3131
if isinstance(x, torch.Tensor):
3232
return x.requires_grad_()
33-
raise ValueError(f'Thing passed to transform API must be Tensor,'
33+
raise ValueError(f'Thing passed to transform API must be Tensor, '
3434
f'got {type(x)}')
3535
return tree_map(create_differentiable, inps)
3636

@@ -296,12 +296,12 @@ def wrapper(*args, **kwargs):
296296
output, aux = output
297297

298298
if not isinstance(output, torch.Tensor):
299-
raise RuntimeError('grad_and_value(f)(*args): Expected f(*args)'
299+
raise RuntimeError('grad_and_value(f)(*args): Expected f(*args) '
300300
f'to return a Tensor, got {type(output)}')
301301
if output.dim() != 0:
302-
raise RuntimeError('grad_and_value(f)(*args): Expected f(*args)'
302+
raise RuntimeError('grad_and_value(f)(*args): Expected f(*args) '
303303
'to return a scalar Tensor, got tensor with '
304-
f'{output.dim()} dims. Maybe you wanted to'
304+
f'{output.dim()} dims. Maybe you wanted to '
305305
'use the vjp or jacrev APIs instead?')
306306

307307
flat_diff_args, spec = tree_flatten(diff_args)

0 commit comments

Comments
 (0)