backport 2.17 shape