Use dict for ndarray type cache
Delete custom type cache implementation