Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundancy in serializing shapes of feature and label volumes #312

Open
hvgazula opened this issue Mar 31, 2024 · 0 comments
Open

Redundancy in serializing shapes of feature and label volumes #312

hvgazula opened this issue Mar 31, 2024 · 0 comments
Milestone

Comments

@hvgazula
Copy link
Contributor

Referring to

for j, s in enumerate(x.shape):
feature["feature/shape/dim{}".format(j)] = _int64_feature(s)
if x.ndim:
feature["feature/shape"] = _bytes_feature(
np.array(x.shape).astype(_TFRECORDS_DTYPE).tobytes()
)

and
for j, s in enumerate(y.shape):
label["label/shape/dim{}".format(j)] = _int64_feature(s)
if y.ndim:
label["feature/shape"] = _bytes_feature(
np.array(y.shape).astype(_TFRECORDS_DTYPE).tobytes()
)

why do we serialize the shapes individually when the array could be serialized?

Check if this has to do with

# TODO: this line does not work. The shape cannot be determined
# dynamically... for now.
# xshape = tf.cast(
# tf.io.decode_raw(e["feature/shape"], _TFRECORDS_DTYPE), tf.int32)

@hvgazula hvgazula changed the title Redundancy is serializing shapes of feature and label volumes Redundancy in serializing shapes of feature and label volumes Mar 31, 2024
@hvgazula hvgazula added this to the 1.2.1 milestone Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant