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

Method ImageDims

tensorflow/compiler/tests/randomized_tests.cc:674–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

672}
673
674std::vector<int64> OpTest::ImageDims(TensorFormat format, int batch,
675 int feature,
676 const std::vector<int64>& spatial_dims) {
677 std::vector<int64> dims;
678 switch (format) {
679 case FORMAT_NHWC:
680 dims.push_back(batch);
681 for (int dim : spatial_dims) {
682 dims.push_back(dim);
683 }
684 dims.push_back(feature);
685 break;
686 case FORMAT_NCHW:
687 dims.push_back(batch);
688 dims.push_back(feature);
689 for (int dim : spatial_dims) {
690 dims.push_back(dim);
691 }
692 break;
693 default:
694 LOG(FATAL) << "Tensor format " << ToString(format) << " not supported.";
695 }
696 return dims;
697}
698
699std::vector<int32> OpTest::AsInt32s(const std::vector<int64>& int64s) {
700 return std::vector<int32>(int64s.begin(), int64s.end());

Callers

nothing calls this directly

Calls 2

ToStringFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected