MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / SetUp

Method SetUp

tensorflow/core/framework/tensor_test.cc:351–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349 zero_t(DT_FLOAT, TensorShape({3, 0, 2, 0, 5})) {}
350
351 void SetUp() override {
352 EXPECT_TRUE(t.shape().IsSameSize(TensorShape({2, 3, 4, 5})));
353 EXPECT_TRUE(zero_t.shape().IsSameSize(TensorShape({3, 0, 2, 0, 5})));
354
355 auto tensor = t.tensor<float, 4>();
356 EXPECT_EQ(2, tensor.dimension(0));
357 EXPECT_EQ(3, tensor.dimension(1));
358 EXPECT_EQ(4, tensor.dimension(2));
359 EXPECT_EQ(5, tensor.dimension(3));
360
361 // Set first and last elements.
362 tensor(0, 0, 0, 0) = 0.01f;
363 tensor(1, 2, 3, 4) = 0.02f;
364 }
365
366 template <typename T>
367 using ReshapeFunc = T (Tensor::*)(gtl::ArraySlice<int64>);

Callers

nothing calls this directly

Calls 4

TensorShapeClass · 0.70
IsSameSizeMethod · 0.45
shapeMethod · 0.45
dimensionMethod · 0.45

Tested by

no test coverage detected