@Override
    public Tensor embed(String text, Context context, TensorType tensorType) {
        if (!verifyTensorType(tensorType)) {
            throw new IllegalArgumentException("Invalid splade embedder tensor destination. " +
                                               "Wanted a mapped 1-d tensor, got " + tensorType);
        }
        var start = System.nanoTime();

        var encoding = tokenizer.encode(text, context.getLanguage());
        runtime.sampleSequenceLength(encoding.ids().size(), context);

        Tensor inputSequence = createTensorRepresentation(encoding.ids(), "d1");
        Tensor attentionMask = createTensorRepresentation(encoding.attentionMask(), "d1");
        Tensor tokenTypeIds = createTensorRepresentation(encoding.typeIds(), "d1");

        Map<String, Tensor> inputs = Map.of(inputIdsName, inputSequence.expand("d0"),
                                            attentionMaskName, attentionMask.expand("d0"),
                                            tokenTypeIdsName, tokenTypeIds.expand("d0"));
        IndexedTensor output = (IndexedTensor) evaluator.evaluate(inputs).get(outputName);
        Tensor spladeTensor = useCustomReduce
                ? sparsifyCustomReduce(output, tensorType)
                : sparsifyReduce(output, tensorType);
        runtime.sampleEmbeddingLatency((System.nanoTime() - start)/1_000_000d, context);
        return spladeTensor;
    }
Validates that the given tensor type is a 1-d mapped tensor.

@param target the type to validate
@return true if the type is a 1-d mapped tensor
model-integration/src/main/java/ai/vespa/embedding/SpladeEmbedder.java