# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. search tensor { document tensor { field f1 type tensor(x[]) { indexing: summary } field f2 type tensor(x[2],y[1]) { indexing: attribute } field f3 type tensor(x{}) { indexing: attribute | summary } field f4 type tensor(x[10],y[20]) { indexing: attribute | summary } field f5 type tensor(x[10]) { indexing: attribute | summary } field f6 type float { indexing: attribute } } rank-profile profile1 { first-phase { expression: sum(map(attribute(f4),f(x)(x*x)) + reduce(random(x[2],y[3]), count) * rename(attribute(f4), (x, y), (y, x))) } } rank-profile profile2 { first-phase { expression: sum(matmul(attribute(f4), diag(x[2],y[2],z[3]), x)) } } rank-profile profile3 { first-phase { expression: sum(joinedtensors()) } function joinedtensors() { expression: tensor(i[10])(i) * attribute(f4) } } rank-profile profile4 { first-phase { expression: sum(attribute(f5)) } } rank-profile profile5 { first-phase { expression: sum(tensor(d0[1],x[2]):[[attribute(f6), sum(attribute(f5))]]) } } rank-profile profile6 { first-phase { expression: sum(tensor(d0[1],x[2]):[[attribute(f6), sum(joinedtensors())]]) } function joinedtensors() { expression: tensor(i[10])(i) * attribute(f4) } } }