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

Method init

tensorflow/core/kernels/unicode_ops.cc:168–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 }
167
168 void init(const string& name) {
169 if (converter_ && name == name_) {
170 // Note: this reset is not typically needed, but if not done, then in some
171 // cases the cached converter will maintain state of input endianness
172 // which isn't valid from input to input in every batched case.
173 ucnv_reset(converter_);
174 return;
175 }
176
177 if (converter_) {
178 ucnv_close(converter_);
179 converter_ = nullptr;
180 name_ = "";
181 }
182
183 UErrorCode status = U_ZERO_ERROR;
184 converter_ = ucnv_open(name.c_str(), &status);
185 if (U_FAILURE(status)) {
186 if (converter_) {
187 ucnv_close(converter_);
188 converter_ = nullptr;
189 }
190 } else {
191 name_ = name;
192 }
193 }
194
195 UConverter* converter_ = nullptr;
196 string name_;

Callers 4

UnicodeTranscodeOpMethod · 0.45
ComputeMethod · 0.45
UnicodeDecodeBaseOpMethod · 0.45
ComputeMethod · 0.45

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected