I suggest you follow the API we wrote for `affine_transform`.