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

tensorflow tile inconsistent with other tensorlibs #1025

Closed
kratsg opened this issue Aug 12, 2020 · 1 comment · Fixed by #1028
Closed

tensorflow tile inconsistent with other tensorlibs #1025

kratsg opened this issue Aug 12, 2020 · 1 comment · Fixed by #1028
Assignees
Labels
bug Something isn't working

Comments

@kratsg
Copy link
Contributor

kratsg commented Aug 12, 2020

Demonstrated rather simply below:

>>> import pyhf
>>> pyhf.tensorlib.tile(pyhf.tensorlib.astensor([1.]), (2, 1))
array([[1.],
       [1.]])

>>> pyhf.set_backend('jax')
>>> pyhf.tensorlib.tile(pyhf.tensorlib.astensor([1.]), (2, 1))

>>> pyhf.set_backend('pytorch')
>>> pyhf.tensorlib.tile(pyhf.tensorlib.astensor([1.]), (2, 1))
tensor([[1.],
        [1.]])

>>> pyhf.set_backend('tensorflow')
>>> pyhf.tensorlib.tile(pyhf.tensorlib.astensor([1.]), (2, 1))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/kratsg/.virtualenvs/pyhf/lib/python3.7/site-packages/pyhf/tensor/tensorflow_backend.py", line 78, in tile
    return tf.tile(tensor_in, repeats)
  File "/Users/kratsg/.virtualenvs/pyhf/lib/python3.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 11393, in tile
    input, multiples, name=name, ctx=_ctx)
  File "/Users/kratsg/.virtualenvs/pyhf/lib/python3.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 11433, in tile_eager_fallback
    ctx=ctx, name=name)
  File "/Users/kratsg/.virtualenvs/pyhf/lib/python3.7/site-packages/tensorflow/python/eager/execute.py", line 60, in quick_execute
    inputs, attrs, num_outputs)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Expected multiples argument to be a vector of length 1 but got length 2 [Op:Tile]
@kratsg kratsg added the bug Something isn't working label Aug 12, 2020
@matthewfeickert
Copy link
Member

matthewfeickert commented Aug 12, 2020

Should we get this addressed before PR #731 goes in? I'm a bit hesitant to specifically add test cases that treat backends different (one of the reasons PR #817 is was taking forever to be ready).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants