Currently TPU does not support dynamic shapes. As so, bucketing logic in tf.summary.histogram() should be outside compiled. Once dynamic shapes are supported, remove this special handling.
Edited: rather than waiting for dynamic shape support, it would be better if we can remove the special-casing by just changing the histogram format to avoid having dynamic shapes at all.