Recreate array using only PyTorch

I am trying to recreate the following array in pure torch. How can I achieve it using nothing but PyTorch?

t_list= float('inf') * np.ones(np.append( 10, 3+ 1 + np.arange( 2)))

@Harry-Garrison I hope this works for you.

t_list = float('inf') * torch.ones( [torch.tensor([10]), 3+1+torch.arange( 2)] ).tolist())
1 Like

Excellent, thank you!

1 Like