Optimize MapByType's getters by direct casting to concrete types instead of using unique_any.
Optimize MapByType's getters by direct casting to concrete types instead of using unique_any.

MapByType has dense type id for type checking, so we don't need another level of type checking in unique_any.

PiperOrigin-RevId: 411206140

tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime