<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
Given a 3d tenzor, say: batch x sentence length x embedding dim
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import pandas as pd
import torch
a = torch.rand((10, 1000, 23))
lengths = torch.randint(1000, (10,))
for i_batch in range(10):
    a[i_batch, :lengths[i_batch], :] = 2333
<END_TASK>