Skip to content

feat: add tensor type#756

Merged
samsja merged 2 commits into
feat-rewritte-v2from
feat-tensor-type
Nov 11, 2022
Merged

feat: add tensor type#756
samsja merged 2 commits into
feat-rewritte-v2from
feat-tensor-type

Conversation

@JohannesMessner

Copy link
Copy Markdown
Member

This adds the typ Tensor that wraps np.ndarray. It adds protobuf serialization and is a valid Pydantic type, other than that it is just a normal ndarray.

@samsja samsja changed the title Feat tensor type feat: add tensor type Nov 11, 2022
@samsja samsja merged commit 5078511 into feat-rewritte-v2 Nov 11, 2022
@samsja samsja deleted the feat-tensor-type branch November 11, 2022 15:50
@@ -1,4 +1,4 @@
import numpy as np
from .tensor import Tensor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please use global import

T = TypeVar('T', bound='Tensor')


class Tensor(np.ndarray, BaseNode):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why does it inherit from np.ndarray?

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.

3 participants