Tfjs: tensor2d works with a rank-3 shape

Created on 27 Apr 2018  路  2Comments  路  Source: tensorflow/tfjs

  • tf.js version: [email protected]
  • chrome: Version 66.0.3359.139 (Official Build) (64-bit)

While making a video tutorial, I found that tf.tensor2d() does not throw an error if I pass it a "rank 3" shape, i.e.:

  const values = [];
  for (let i = 0; i < 30; i++) {
    values[i] = Math.random()*100;
  }
  const shape = [2, 5, 3];
  const data = tf.tensor2d(values, shape, 'int32');
  console.log(data.toString());
core

Most helpful comment

CHOO CHOO!

All 2 comments

CHOO CHOO!

I saw you comment "const data = tf.tensor2d(values, shape, 'int32');" you sneaky bastard ;)))

Was this page helpful?
0 / 5 - 0 ratings