Difficulty with built-in functions inside lambdas

6 views
Skip to first unread message

Richard Gomes

unread,
Nov 22, 2012, 7:07:13 PM11/22/12
to copperhe...@googlegroups.com
Hello,

The line commented out below does not compile.
Seems like we cannot call built in functions in lambdas inside kernels.

@cutype("([Float], Float, Long) -> Float")
@cu
def cm2(v, m, n):
    # return sum(map(lambda x: pow(x-m, 2), v)) / float32(n)                                                                                            
    return sum(map(lambda x: (x-m)*(x-m), v)) / float32(n)

Any ideas?

Thanks

Bryan Catanzaro

unread,
Nov 22, 2012, 9:17:36 PM11/22/12
to copperhe...@googlegroups.com
You're right, pow isn't yet supported. Please add an issue to github
to track this problem, so that I don't forget. =)

- bryan
Reply all
Reply to author
Forward
0 new messages