The code you see here doesn't make too much sense in native Lua without further code. It is commonly used in Torch. I found your snippet in a torch related script online. So I guess that's a valid guess.
I'm not very experienced with Torch, but from what I see in the documentation this will give you a sub-tensor of context_proto. row 1-batchSize and col source_l * imgH.
I think it is called slicing and it is covered in the following demo/tutorial:
https://github.com/torch/demos/blob/master/tensors/slicing.lua
print 'more complex slicing can be done using the [{}] operator'
print 'this operator lets you specify one list/number per dimension'
print 'for example, t2 is a 2-dimensional tensor, therefore'
print 'we should pass 2 lists/numbers to the [{}] operator:'
print ''
t2_slice1 = t2[{ {},2 }]
t2_slice2 = t2[{ 2,{} }] -- equivalent to t2[2]
t2_slice3 = t2[{ {2},{} }]
t2_slice4 = t2[{ {1,3},{3,4} }]
t2_slice5 = t2[{ {3},{4} }]
t2_slice6 = t2[{ 3,4 }]
...
Please refer to the torch documentation for more details.
https://github.com/torch/torch7/blob/master/doc/tensor.md#tensor--dim1dim2--or--dim1sdim1e-dim2sdim2e-
getmetatable(context_proto).__indexwill be called with{{1, batch_size}, {1, source_l*imgH}}as second parameter, and the result of this call will be assigned tocontext