Search in sources :

Example 1 with MappedTensor

use of com.yahoo.tensor.MappedTensor in project vespa by vespa-engine.

the class JsonReaderTestCase method testParsingOfMappedTensorWithCells.

@Test
public void testParsingOfMappedTensorWithCells() {
    Tensor tensor = assertMappedTensorField("{{x:a,y:b}:2.0,{x:c,y:b}:3.0}}", createPutWithMappedTensor("{ " + "  \"cells\": [ " + "    { \"address\": { \"x\": \"a\", \"y\": \"b\" }, " + "      \"value\": 2.0 }, " + "    { \"address\": { \"x\": \"c\", \"y\": \"b\" }, " + "      \"value\": 3.0 } " + "  ]" + "}"));
    // any functional instance is fine
    assertTrue(tensor instanceof MappedTensor);
}
Also used : Tensor(com.yahoo.tensor.Tensor) IndexedTensor(com.yahoo.tensor.IndexedTensor) MappedTensor(com.yahoo.tensor.MappedTensor) MappedTensor(com.yahoo.tensor.MappedTensor) Test(org.junit.Test)

Aggregations

IndexedTensor (com.yahoo.tensor.IndexedTensor)1 MappedTensor (com.yahoo.tensor.MappedTensor)1 Tensor (com.yahoo.tensor.Tensor)1 Test (org.junit.Test)1