'Shifts input array
Arguments:
ary: tensor
shift_ary: tensor of shift amount
out: reference to output'

def shift(self, ary, shift_ary, value=True, out=None):

    if value:
        exp = self.rint((self.safelog(self.absolute(shift_ary)) / self.log(2)))
        ap2 = self.multiply(self.sgn(shift_ary), self.exp2(exp))
    else:
        ap2 = self.exp2(shift_ary)
    if (out is None):
        if hasattr(ary, 'shape'):
            out = self.empty_like(ary)
        else:
            out = self.empty((1, 1))
    out[:] = self.multiply(ary, ap2)
    return out
