Skip to content

Commit

Permalink
use proper argument for FixedShape (#169)
Browse files Browse the repository at this point in the history
Co-authored-by: Karl Higley <kmhigley@gmail.com>
  • Loading branch information
rjzamora and karlhigley authored Nov 18, 2022
1 parent 4c4e0f1 commit b298635
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions merlin/schema/io/tensorflow_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
import numpy

from merlin.schema.io import proto_utils, schema_bp
from merlin.schema.io.schema_bp import Feature, FeatureType, FixedShape, FloatDomain, IntDomain
from merlin.schema.io.schema_bp import (
Feature,
FeatureType,
FixedShape,
FixedShapeDim,
FloatDomain,
IntDomain,
)
from merlin.schema.io.schema_bp import Schema as ProtoSchema
from merlin.schema.io.schema_bp import ValueCount
from merlin.schema.schema import ColumnSchema
Expand Down Expand Up @@ -281,7 +288,7 @@ def _pb_feature(column_schema):
max_length = value_count.get("max")

if min_length and max_length and min_length == max_length:
feature.shape = FixedShape(min_length)
feature.shape = FixedShape([FixedShapeDim(size=min_length)])
elif min_length and max_length and min_length < max_length:
feature.value_count = ValueCount(min=min_length, max=max_length)
else:
Expand Down

0 comments on commit b298635

Please sign in to comment.