mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-25 20:49:37 +01:00
fix lint issue
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user