Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

fix index for min #1105

Merged
merged 3 commits into from
Jun 19, 2018
Merged

fix index for min #1105

merged 3 commits into from
Jun 19, 2018

Conversation

jbencook
Copy link
Contributor

@jbencook jbencook commented Jun 15, 2018

Description

This PR fixes a bug in tf.min for the cpu backend where if you compute the min along an axis it returns the global min for each element, e.g.

tf.setBackend('cpu');
tf.tensor([[1, 2], [3, 4]]).min(0).print();

returns

Tensor
    [1, 1]

I'm not super familiar with these operations but the index of the flat typed array was fixed at 0 instead of using the offset that the other reduction operations use. Changing that seems to fix the behavior I was seeing.


For repository owners only:

Please remember to apply all applicable tags to your pull request.
Tags: FEATURE, BREAKING, BUG, PERF, DEV, DOC, SECURITY

For more info see: /~https://github.com/tensorflow/tfjs/blob/master/DEVELOPMENT.md


This change is Reviewable

@nsthorat
Copy link
Contributor

:lgtm_strong:


Review status: :shipit: complete! 1 of 1 LGTMs obtained


Comments from Reviewable

@nsthorat nsthorat merged commit a925209 into tensorflow:master Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants