torch.sub# torch.sub(input, other, *, alpha=1, out=None) → Tensor# Subtracts other, scaled by alpha, from input. outi=inputi−alpha×otheri ext{{out}}_i = ext{{input}}_i - ext{{alpha}} imes ext{{other}}_i outi=inputi−alpha×otheriSupports broadcasting to a common shape, type promotion, and integer, float, and complex inputs. Parameters input (Tensor) – the input tensor. other (Tensor or Number) – the tensor or number to subtract from input. Keyword Arguments alpha (Number) – the multiplier for other. out (Tensor, optional) – the output tensor. Example: >>> a = torch.tensor((1, 2)) >>> b = torch.tensor((0, 1)) >>> torch.sub(a, b, alpha=2) tensor([1, 0])