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

Function FormatFromString

tensorflow/core/util/tensor_format.cc:76–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76bool FormatFromString(const string& format_str, TensorFormat* format) {
77 if (format_str == "NHWC" || format_str == "NDHWC") {
78 *format = FORMAT_NHWC;
79 return true;
80 }
81 if (format_str == "NCHW" || format_str == "NCDHW") {
82 *format = FORMAT_NCHW;
83 return true;
84 }
85 if (format_str == "NCHW_VECT_C") {
86 *format = FORMAT_NCHW_VECT_C;
87 return true;
88 }
89 if (format_str == "NHWC_VECT_W") {
90 *format = FORMAT_NHWC_VECT_W;
91 return true;
92 }
93 if (format_str == "HWNC") {
94 *format = FORMAT_HWNC;
95 return true;
96 }
97 if (format_str == "HWCN") {
98 *format = FORMAT_HWCN;
99 return true;
100 }
101 return false;
102}
103
104bool FilterFormatFromString(const string& format_str,
105 FilterTensorFormat* format) {

Callers 15

VerifyFunction · 0.85
matchAndRewriteMethod · 0.85
matchAndRewriteMethod · 0.85
matchAndRewriteMethod · 0.85
CreateMethod · 0.85
FusedBatchNormOpMethod · 0.85
FusedBatchNormGradOpMethod · 0.85
MaxPoolOpMethod · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68