bug fix for t-SNE (issue #3526) with new inputs

New fix following the discussion on the previous pull request. Thanks to @jnothman,  @mblondel and others ..