GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: fix deepcopy torchtensor by JoanFM · Pull Request #1720 · docarray/docarray

This repository was archived by the owner on Sep 9, 2026. It is now read-only.

Conversation

@JoanFM

@JoanFM JoanFM commented Jul 21, 2023

Copy link
Copy Markdown
Member

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JoanFM
JoanFM requested a review from samsja July 21, 2023 07:27
@JoanFM JoanFM linked an issue Jul 21, 2023 that may be closed by this pull request
TorchTensor cannot be deep copied. #1719
Closed
@github-actions github-actions Bot added size/s area/core area/testing area/typing labels Jul 21, 2023
@codecov

codecov Bot commented Jul 21, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.72 🎉

Comparison is base (007f113) 84.84% compared to head (7b1384b) 85.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1720      +/-   ##
==========================================
+ Coverage   84.84%   85.56%   +0.72%     
==========================================
  Files         133      133              
  Lines        8583     8585       +2     
==========================================
+ Hits         7282     7346      +64     
+ Misses       1301     1239      -62     
Flag Coverage Δ
docarray 85.56% <100.00%> (+0.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
docarray/typing/tensor/torch_tensor.py 91.08% <100.00%> (+0.18%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Joan Fontanals Martinez
fix: fix deepcopy torchtensor
7b1384b
Signed-off-by: Joan Fontanals Martinez <[email protected]>
@JoanFM
JoanFM force-pushed the fix-torch-tensor-deepcopy branch from 2d79034 to 7b1384b Compare July 21, 2023 07:32
@github-actions

github-actions Bot commented Jul 21, 2023

Copy link
Copy Markdown

📝 Docs are deployed on https://ft-fix-torch-tensor-deepcopy--jina-docs.netlify.app 🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

samsja
samsja reviewed Jul 21, 2023
View reviewed changes
Comment thread docarray/typing/tensor/torch_tensor.py
"""cast itself to a numpy array"""
return self.detach().cpu().numpy()

def new_empty(self, *args, **kwargs):

@samsja samsja Jul 21, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

can we copy the full signature of the original method ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JoanFM JoanFM Jul 21, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

if it is always the same, I do not think it makes sense, this is way more mantainable

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@samsja samsja Jul 21, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

But this break everything related to mypy and pycharm feature. In DocArray v2 we always repeat the full signature of the function

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JoanFM JoanFM Jul 21, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

but mypy check passes

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JoanFM JoanFM Jul 21, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The method on TorchEmbedding does the same.
This is a method that noone should use
It is easier to forget to update this method than anything else.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@samsja samsja Jul 21, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

okay oaky

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@samsja samsja Jul 21, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

mypy pass because it does not look at it. It will only check if there is type hint

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@JoanFM
JoanFM requested a review from samsja July 21, 2023 11:48
@JoanFM
JoanFM merged commit 304a4e9 into main Jul 21, 2023
@JoanFM
JoanFM deleted the fix-torch-tensor-deepcopy branch July 21, 2023 12:17
@jupyterjazz jupyterjazz mentioned this pull request Aug 1, 2023
Release Notes v0.37.0 #1740
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@samsja samsja Awaiting requested review from samsja

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area/core area/testing area/typing size/s

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

TorchTensor cannot be deep copied.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@JoanFM @samsja
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.