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

Define size for things with get_shape #102

Closed
oxinabox opened this issue Nov 6, 2016 · 3 comments
Closed

Define size for things with get_shape #102

oxinabox opened this issue Nov 6, 2016 · 3 comments

Comments

@oxinabox
Copy link
Collaborator

oxinabox commented Nov 6, 2016

get_shape seems to be TensorFlow for Base.size.
But with the ability for it to be unknown etc.

Eg

get_shape(Ts) 
Out[93]:
TensorShape[407, 16]
In [96]:

get_shape(X_ids)
Out[96]:
TensorShape[unknown]

Does it makes sense to define a overload for Base.size, that returns a tuple of Ints, or throws an exception if the size is unknown?

@malmaud
Copy link
Owner

malmaud commented Nov 9, 2016

I'm reluctant to do that since size(::Tensor) already has a meaning in Julia - the Julia 'size' of any non-container object is () and it could get confusing to alter that meaning for tensors. But I am open to counter-arguments.

@IainNZ
Copy link

IainNZ commented Nov 14, 2016

+1 for not conflating the two, the details are sufficiently different that I think it could only be confusing.

@malmaud
Copy link
Owner

malmaud commented Nov 16, 2016

OK, I'll close for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants