fix lint issue

This commit is contained in:
mulin.lyh
2023-09-26 11:00:08 +08:00
parent d57bd0bfd6
commit 223f13ae80
3 changed files with 9 additions and 10 deletions

View File

@@ -173,8 +173,8 @@ class TensorVMSplitVQ(TensorVMSplit):
torch.from_numpy(unpack1).reshape(vq_count, bits).long(),
bits=bits)
vq_data = codebook[0, unpack2, :] # N*len
vq_data = vq_data.T.reshape(*(
self.app_plane[idx_plane][:, :, vq_mask].shape))
vq_data = vq_data.T.reshape(
*(self.app_plane[idx_plane][:, :, vq_mask].shape))
self.app_plane[idx_plane].data[:, :, vq_mask] = vq_data
for idx_plane in range(3):
@@ -197,8 +197,8 @@ class TensorVMSplitVQ(TensorVMSplit):
torch.from_numpy(unpack1).reshape(vq_count, bits).long(),
bits=bits)
vq_data = codebook[0, unpack2, :] # N*len
vq_data = vq_data.T.reshape(*(
self.density_plane[idx_plane][:, :, vq_mask].shape))
vq_data = vq_data.T.reshape(
*(self.density_plane[idx_plane][:, :, vq_mask].shape))
self.density_plane[idx_plane].data[:, :, vq_mask] = vq_data
def forward(self,

View File

@@ -46,9 +46,8 @@ def mesh_warp_frame(frame, x_motion, y_motion, cap_width, cap_height):
homo,
origin_kp.contiguous().view(2, -1).permute(1, 0)).permute(1, 0)
projection.append(
projected_kp.contiguous().view(*origin_kp.shape).permute(
1, 2, 0)) # 2, H, W --> H, W, 2
projection.append(projected_kp.contiguous().view(
*origin_kp.shape).permute(1, 2, 0)) # 2, H, W --> H, W, 2
projection = torch.stack(projection, 0)
projection[:, :, :, 0] = projection[:, :, :, 0] / cfg.MODEL.WIDTH * 2. - 1.

View File

@@ -430,9 +430,9 @@ class MOELayer(Base):
self.use_expert_residual_network = use_expert_residual_network
if self.use_expert_residual_network:
self.expert_network = nn.Sequential(
*([ExpertResidualLayer(self.gate.model_dim)
for _ in range(6)])) # noqa
self.expert_network = nn.Sequential(*([
ExpertResidualLayer(self.gate.model_dim) for _ in range(6)
])) # noqa
self.use_tutel = use_tutel and TUTEL_INSTALLED