As for translation:
translation_x = 100*2/w
translation_y = 10*2/h

rotation_yaw = torch.tensor([
    [ cos(angle_rad), sin(angle_rad)*h/w, translation_x],
    [-sin(angle_rad)*w/h, cos(angle_rad), translation_y],
]).unsqueeze(0).cuda()