subtract¶
- metatensor.subtract(A: TensorMap, B: float | int | TensorMap) TensorMap[source]¶
Return a new
TensorMapwith the values being the subtract ofAandB.If
Bis aTensorMapit has to have the same metadata asA.If gradients are present in
A:Bis a scalar:\[\nabla(A - B) = \nabla A\]Bis aTensorMapwith the same metadata ofA:\[\nabla(A - B) = \nabla A - \nabla B\]
- Parameters:
- Returns:
New
TensorMapwith the same metadata asA.- Return type: