Update dim

Find shared dimensions was not compatible with inference for more than
2 modalities.