Add scalar() function.

Change-Id: I1d1183e926a18fc98c9e94bbb9a808a3fb313102
Merge "Add scalar() function."