code: def from_list(xs):
      starts = np.full((len(xs) + 1,), -1, dtype=np.long)
      data = np.concatenate(xs, axis=0)
      starts[0] = 0
      for i, x in enumerate(xs):
          starts[i + 1] = starts[i] + x.shape[0]
      assert (starts > -1).all()
      return ShardedTensor(data, starts)
  
file_path: fairseq/examples/MMPT/mmpt/utils/shardedtensor.py
imports: import os
  import pickle
  import numpy
label_desc: Use image node_id 2 for calling the ShardedTensor obj's underlying member method code with example usage: obj.from_list(xs) and returns: ShardedTensor