xnn.common.models.ops.cell_volume#

xnn.common.models.ops.cell_volume(cell)[source]#

Volume of row-vector cells (..., 3, 3) as the scalar triple product.

Used instead of torch.det for cell volumes: the backward of det builds an LU solve in the process default dtype, so a float32 model served in a process whose default is float64 fails in the force pass (torch 2.5). The triple product differentiates in the cell’s own dtype and is scriptable.

Parameters:

cell (Tensor)

Return type:

Tensor