Is it safe to call SameDiff.evaluate during training phase

I’ve noticed that SameDiff.output/SameDiff.fit (training phase) and SameDiff.evaluate modify internal SameDiff state quite a bit. JavaDoc does not specify is it safe to call SameDiff.evaluate when performing SameDiff.fit (I need something like data preprocessor that runs directly within SameDiff evaluation rather than as preprocessor inside BaseDatasetIterator).

As I’ve found several implementation options, here are the questions I have regarding each of option:

  1. Is it safe to execute SameDiff.evaluate inside custom DifferentialFunction while executing SameDiff.fit? Or it is safer to use SameDiff.invokeGraphOn on some copy instead
  2. Is it safe to execute SameDiff.evaluate inside custom training listener that will modify network inputs while executing SameDiff.fit? Or it is safer to use SameDiff.invokeGraphOn on some copy instead