1. range(n)生成[0,n)区间的整数 (左闭右开)
2.a[start:end:step] [start,end) (左闭右开)
3.当step等于负数的时候,从右向左取数。注意:numpy支持负数,torch.tensor不支持
4.a[:end]:取得范围为[0,end)
1. range(n)生成[0,n)区间的整数 (左闭右开)
2.a[start:end:step] [start,end) (左闭右开)
3.当step等于负数的时候,从右向左取数。注意:numpy支持负数,torch.tensor不支持
4.a[:end]:取得范围为[0,end)