Tfjs: add `meshgrid` function

Created on 29 Sep 2019  路  4Comments  路  Source: tensorflow/tfjs

would be nice to have an equiv of tf.meshgrid in python tensorflow.

core contributions welcome feature

Most helpful comment

  x = tf.linspace(-1, 1, w);
  y = tf.linspace(-1, 1, h);

  const xx = tf.matMul( tf.ones  ([h, 1]), x.reshape([1, w]) )
  const yy = tf.matMul( y.reshape([h, 1]), tf.ones  ([1, w]) );

vs. xx, yy = tf.meshgrid(x, y)

All 4 comments

@silky can you please tell us your use case ?

  x = tf.linspace(-1, 1, w);
  y = tf.linspace(-1, 1, h);

  const xx = tf.matMul( tf.ones  ([h, 1]), x.reshape([1, w]) )
  const yy = tf.matMul( y.reshape([h, 1]), tf.ones  ([1, w]) );

vs. xx, yy = tf.meshgrid(x, y)

Hello @rthadur, I see you closed this issue. Does this mean the feature was implemented? Or that it is not going to be implemented, after all? Or that there is a good alternative to achieve the desired behavior? Thank you very much!

Friendly ping @rthadur :)

Was this page helpful?
0 / 5 - 0 ratings