-
Notifications
You must be signed in to change notification settings - Fork 74k
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
[feature request] numpy style shape
sugar
#586
Comments
I'd prefer not to have two ways to access (subtly different forms of) the same information. However, I wouldn't be opposed to changing |
It is OK for me even now as is, the question what is the optimal / general way ;) In my opinion, I see two possible solution based on what you said and on criterion whether the (1) if (2) if |
Are there any plans on changing this? @DSLituiev's comment sounds very reasonable to me. |
There are no plans to change the use of |
What is the use of |
Do you imply that you'll oppose |
Tensors in TensorFlow can have dynamic shapes. So, yes, I'd be opposed to having two slightly incompatible properties/methods on Which tensor initialization function doesn't support |
@mrry I totally agree that we shouldn't have both >>> import tensorflow as tf
>>> a = tf.placeholder(tf.float32, [None, None, None])
>>> b = tf.reshape(a, [a.get_shape()[0], 10, -1])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1092, in reshape
name=name)
File "/usr/lib/python3.5/site-packages/tensorflow/python/ops/op_def_library.py", line 411, in apply_op
as_ref=input_arg.is_ref)
File "/usr/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 566, in convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/usr/lib/python3.5/site-packages/tensorflow/python/ops/constant_op.py", line 179, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/usr/lib/python3.5/site-packages/tensorflow/python/ops/constant_op.py", line 162, in constant
tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape))
File "/usr/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py", line 332, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/usr/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py", line 272, in _AssertCompatible
(dtype.name, repr(mismatch), type(mismatch).__name__))
TypeError: Expected int32, got Dimension(None) of type 'Dimension' instead.
>>> |
probably this was the function. On the other hand,
@mrry, you must know better, but I never yet faced an expression where I had to feed |
I mean: I understand that |
@mrry: Should this be contributions welcome, or do we still have plans to do our own refactoring of |
We can't—or, at least, really shouldn't—accept a contribution on this until the internal refactoring is done. However, the internal refactoring is P3, so it might be some time before it rises to the top of the pile. |
Sounds good, let's leave it as is. |
@mrry Any news on the internal refactoring? |
@mrry friendly ping? |
This remains blocked on a low-priority internal cleanup. I'd be happy to hand it off to somebody who is looking for something to do, but—due to the nature of the conflict—they would need to be a Google employee, |
@mrry Maybe I can help? I'm currently interning at Google MTV, feel free to ping me. |
@danijar I'll be in touch! |
What's the status of this? @yifeif may be able to help. |
That would be perfect. I don't have the time for it, unfortunately. Can you contact @mrry? |
per request from tensorflow#586 Change: 141922517
Fixed by commit above. |
Update cifar input following data change.
I'd like to suggest numpy-like
shape
read-only property fortf.Tensor
, something like:The text was updated successfully, but these errors were encountered: