Skip to content

[Bug] reduce_logsumexp examples do not work in 0.11.0rc1 #5291

Closed

Description

@hoangmit

Version: 0.11.0rc1

These examples do not work:

# 'x' is [[0, 0, 0]]
#         [0, 0, 0]]
tf.reduce_logsumexp(x, 0) ==> [log(2), log(2), log(2)]
tf.reduce_logsumexp(x, 1) ==> [log(3), log(3)]

Because:
tf.squeeze(t, squeeze_dims) does not take integer for squeeze_dims

Activity

  1. drpngx commented on Oct 30, 2016

    @drpngx
    Contributor

    Nice find! So you mean we should use 0.0 etc? Feel free to send a PR for the docs.

  2. hoangmit commented on Oct 30, 2016

    @hoangmit
    ContributorAuthor

    No. I mean this is a bug. Currently, tf.reduce_logsumexp(x, 0) crashes. It should return the result in the doc.

  3. changed the title [-]reduce_logsumexp examples do not work in 0.11.0rc1[/-] [+][Bug] reduce_logsumexp examples do not work in 0.11.0rc1[/+] on Oct 30, 2016
  4. drpngx commented on Oct 31, 2016

    @drpngx
    Contributor

    Does it crash or return an error?

  5. hoangmit commented on Oct 31, 2016

    @hoangmit
    ContributorAuthor

    It returns an error:

    ...lib/python2.7/site-packages/tensorflow/python/ops/math_ops.pyc in reduce_logsumexp(input_tensor, reduction_indices, keep_dims, name)
       1293         keep_dims=True)) + my_max
       1294     if not keep_dims:
    -> 1295       result = array_ops.squeeze(result, reduction_indices)
       1296     return result
       1297 
    
    ...lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.pyc in squeeze(input, squeeze_dims, name)
       2644   """
       2645   result = _op_def_lib.apply_op("Squeeze", input=input,
    -> 2646                                 squeeze_dims=squeeze_dims, name=name)
       2647   return result
       2648 
    
    ...lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.pyc in apply_op(self, op_type_name, name, **keywords)
        636         if attr_def.type.startswith("list("):
        637           if not _IsListValue(value):
    --> 638             raise TypeError("Expected list for attr " + key)
        639           if attr_def.has_minimum:
        640             if len(value) < attr_def.minimum:
    
    TypeError: Expected list for attr squeeze_dims
    
  6. drpngx commented on Oct 31, 2016

    @drpngx
    Contributor

    Oh, you can't send a list directly, you have to construct a tensor, for instance, with zero_initializer.

  7. hoangmit commented on Oct 31, 2016

    @hoangmit
    ContributorAuthor

    It is not the problem with the input. (e.g.# 'x' is [[0, 0, 0], [0, 0, 0]])
    I did construct a tensor and pass it in.

    The problem is at line 1295 in file "tensorflow/python/ops/math_ops.py". array_ops.squeeze does not take integer as the 2nd parameter.

  8. drpngx commented on Oct 31, 2016

    @drpngx
    Contributor

    Ah, ok, thanks! Feel free to submit a PR with doc changes.

  9. added a commit that references this issue on Oct 31, 2016
  10. added a commit that references this issue on Nov 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions