@Override
    public FieldValue applyTo(FieldValue oldValue) {
        if ( ! (oldValue instanceof TensorFieldValue)) {
            throw new IllegalStateException("Cannot use tensor remove update on non-tensor datatype " + oldValue.getClass().getName());
        }
        if ( ! ((TensorFieldValue) oldValue).getTensor().isPresent()) {
            throw new IllegalArgumentException("No existing tensor to apply update to");
        }
        if ( ! tensor.getTensor().isPresent()) {
            return oldValue;
        }

        Tensor old = ((TensorFieldValue) oldValue).getTensor().get();
        Tensor update = tensor.getTensor().get();
        // TODO: handle the case where this tensor only contains a subset of the sparse dimensions of the input tensor.
        Tensor result = old.remove(update.cells().keySet());
        return new TensorFieldValue(result);
    }
An update used to remove cells from a sparse tensor or dense sub-spaces from a mixed tensor.

The specification of which cells to remove contains addresses using a subset or all of the sparse dimensions of the tensor type.
This is represented as a sparse tensor where cell values are set to 1.0.
document/src/main/java/com/yahoo/document/update/TensorRemoveUpdate.java