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

Intrinsics #2207

Merged
merged 20 commits into from
Mar 8, 2023
Merged

Intrinsics #2207

merged 20 commits into from
Mar 8, 2023

Conversation

farizrahman4u
Copy link
Contributor

@farizrahman4u farizrahman4u commented Feb 28, 2023

🚀 🚀 Pull Request

Checklist:

  • My code follows the style guidelines of this project and the Contributing document
  • I have commented my code, particularly in hard-to-understand areas
  • I have kept the coverage-rate up
  • I have performed a self-review of my own code and resolved any problems
  • I have checked to ensure there aren't any other open Pull Requests for the same change
  • I have described and made corresponding changes to the relevant documentation
  • New and existing unit tests pass locally with my changes

Changes

Add intrinsics htype.

@tatevikh tatevikh requested review from adolkhan and FayazRahman March 6, 2023 15:31
@@ -20,13 +21,15 @@ def __setstate__(self, state: Dict[str, Any]):

def tobytes(self) -> bytes:
d = {str(k): v for k, v in self.__getstate__().items()}
return bytes(json.dumps(d, sort_keys=True, indent=4), "utf-8")
return bytes(
json.dumps(d, sort_keys=True, indent=4, cls=HubJsonEncoder), "utf-8"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because intrinsics are numpy arrays.


@classmethod
def frombuffer(cls, buffer: bytes):
instance = cls()
if len(buffer) > 0:
instance.__setstate__(json.loads(buffer))
instance.__setstate__(json.loads(buffer, cls=HubJsonDecoder))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here?

deeplake/htype.py Show resolved Hide resolved
Copy link
Contributor

@FayazRahman FayazRahman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check the dimensions of intrinsics samples during upload

@FayazRahman FayazRahman self-requested a review March 7, 2023 05:39
@farizrahman4u farizrahman4u merged commit f575a12 into main Mar 8, 2023
@farizrahman4u farizrahman4u deleted the fr_d3d branch March 8, 2023 12:48
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

Successfully merging this pull request may close these issues.

4 participants