Skip to content

Commit 58f9b9e

Browse files
zoyahavtfx-copybara
authored andcommitted
Infer tensor representations from Features even if some TRs are already present in
TFXIOs. The reason for this change is to avoid ignoring provided features when unrelated TRs are provided as well for a less confusing behaviour. PiperOrigin-RevId: 487586847
1 parent c71d851 commit 58f9b9e

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

tensorflow_transform/beam/impl.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -925,21 +925,10 @@ class _InstanceDictInputToTFXIOInput(beam.PTransform):
925925

926926
def __init__(self, schema, desired_batch_size):
927927
self._schema = schema
928-
# Infer all features in the schema as TensorRepresentations. This is needed
929-
# because TFXIO will ignore Features if TensorRepresentations are present in
930-
# the schema.
931-
# TODO(b/202791319) Investigate whether this should be done at TFXIO level.
932-
tensor_representations = (
933-
tensor_representation_util.InferTensorRepresentationsFromMixedSchema(
934-
schema))
935-
extended_schema = schema_pb2.Schema()
936-
extended_schema.CopyFrom(schema)
937-
tensor_representation_util.SetTensorRepresentationsInSchema(
938-
extended_schema, tensor_representations)
939928
self._tfxio = tf_example_record.TFExampleBeamRecord(
940929
physical_format='inmem',
941930
telemetry_descriptors=['StandaloneTFTransform'],
942-
schema=extended_schema)
931+
schema=schema)
943932
self._desired_batch_size = desired_batch_size
944933

945934
def tensor_adapter_config(self):

0 commit comments

Comments
 (0)