Thanks for your attention.
I can reproduce this issue by run code twice.
model = torchvision.models.resnet18()
# An example input you would normally provide to your model's forward() method.
example = torch.rand(1, 3, 224, 224)
# Use torch.jit.trace to generate a torch.jit.ScriptModule via tracing.
traced_script_module = torch.jit.trace(model, example)

output = traced_script_module.forward(torch.ones(1,3,224,224))
traced_script_module.save("traced_resnet_model.pt")
#eg: first get: tensor([-0.0645,  0.1313, -0.3563, -0.0869,  0.3209], grad_fn=<SliceBackward>)
#   second get: tensor([-0.1508, -0.2974,  0.0963, -0.1596, -0.7377], grad_fn=<SliceBackward>)
print(output[0, :5])

Basing code above，i run it first get tensor [-0.0645,  0.1313, -0.3563, -0.0869,  0.3209], and i try to run it again, i will get tensor[-0.1508, -0.2974,  0.0963, -0.1596, -0.7377]. The only difference between two procedures are var example. it seems to generate diffenent traced script. Besides, i compared to binary traced_resnet_model.pts, they are absolutly different,as shown below.
>> cmp traced_resnet_model_1.pt traced_resnet_model_2.pt 
>> raced_resnet_model_1.pt traced_resnet_model_2.pt differ: char 51, line 1


image1920×441 189 KB