self.checkScript(fn, ("h"))
self.checkScript(fn, ("y"))
+ def index_str_to_tensor(s):
+ # type: (str) -> int
+ return torch.tensor(ord(s))
+
+ s = u'\u00a3'.encode('utf8')[:1]
+ self.checkScript(index_str_to_tensor, (s,))
+
def test_string_slicing(self):
def fn1(x):
# type: (str) -> str
string.size() == 1,
"String for ord() must be 1 character, found",
string.size());
- push(stack, int64_t(string.at(0)));
+ uint8_t ord = string.at(0);
+ push(stack, int64_t(ord));
return 0;
}),
#define CREATE_COPY_OP(other_type, c_type) \