How to handle warning on running tfx.components.Transform

During running of tfx.components.Transform (for example C2W2_Assignment, Exercise 7) I can see the following warning raised 6 times:

WARNING:absl:Tables initialized inside a tf.function will be re-initialized on every invocation of the function. This re-initialization can have significant impact on performance. Consider lifting them out of the graph context using tf.init_scope.: compute_and_apply_vocabulary_2/apply_vocab/text_file_init/InitializeTableFromTextFileV2

I have several questions on this.

  1. Why this warning is raised multiple times? (My best guess is that tfx reread vocabulary data from file for every batch.)
  2. How to prevent reinitialization of such kind of tables during transformation?
  3. ( offtopic) If my guess regarding first question is correct. Than how can we control batch size.

Thanks for bringing this up. The staff have been informed about this.