Код: Выделить всё
def parse_tf_record(example_proto: tf.train.Example, symbols: t.List[str], all_indicators: t.List[str], indicators: t.List[str]) -> None:
feature_description = {symbol: tf.io.FixedLenFeature([len(all_indicators)], tf.float32, default_value=0.0) for symbol in symbols}
feature_description[constants.DEF_DAY_ID] = tf.io.FixedLenFeature([], tf.int64, default_value=0)
return tf.io.parse_single_example(example_proto, feature_description)
def get_dataset_from_files(paths: t.List[pl.Path], symbols: t.List[str], all_indicators: t.List[str], indicators: t.List[str]) -> tf.data.TFRecordDataset:
paths: t.List[str] = [str(p) for p in paths]
dataset = tf.data.TFRecordDataset(paths, compression_type=COMPRESSION_TYPE)
dataset = dataset.map(lambda x: parse_tf_record(x, symbols, all_indicators, indicators))
return dataset
Я видел много «намеков» на то, что это ожидаемое поведение (SO, проблема с github), но я не видел объяснения, почему.
Итак, мой вопрос:
Как возможно, что функция в Python выполняется (если Ставлю печать, он печатает), но отладчик на этом не останавливается? Как они этого добились?