Hello Johnson!



 Johnson_Mark:

tensor_x_first = tensor_x[:by,...]  * tensor_y
tensor_x[:by,...] = tensor_x_first



Try:
tensor_z = tensor_x * torch.cat ((tensor_y, torch.ones_like (tensor_y)), dim = 0)

Best.
K. Frank