shairubin / fun_with_ast

let's have fun manipulating ASTs in Python
Apache License 2.0
0 stars 1 forks source link

with matcher skip end of line #314

Closed shairubin closed 5 months ago

shairubin commented 5 months ago

with open("caffe2/test/test_img/p1.jpg", "rb") as fp:   weight = torch.full((3,), 1.0 / 255.0).diag()   bias = torch.zeros(3)   byte_tensor = torch.tensor(list(fp.read())).byte()   im2_tensor = torch.ops.fb.image_decode_to_NCHW(byte_tensor, weight, bias)   self.assertEqual(raw_data.shape, im2_tensor.shape)   self.assertEqual(raw_data, im2_tensor, atol=0.1, rtol=1e-01)