class_docstr: TaskSampler where each task has its own constructor.
  
  Generally, this is used when the different tasks are completely different
  environments.
  
  Args:
      env_constructors (list[Callable[Environment]]): Callables that produce
          environments (for example, environment types).
class_docstr_tok: ["TaskSampler","where","each","task","has","its","own","constructor",".","Generally",",","this","is","used","when","the","different","tasks","are","completely","different","environments",".","Args",":","env_constructors","(","list","[","Callable","[","Environment","]","]",")",":","Callables","that","produce","environments","(","for","example",",","environment","types",")","."]
docstr: int: the number of tasks.
docstr_tok: ["int",":","the","number","of","tasks","."]
code: def n_tasks(self):
      """int: the number of tasks."""
      return len(self._env_constructors)
  
imports: import abc
  import copy
  import math
  import numpy
  from garage.envs import GymEnv, TaskNameWrapper, TaskOnehotWrapper
  from garage.sampler.env_update import ExistingEnvUpdate, NewEnvUpdate, SetTaskUpdate
label_desc: Use image node_id 2 for calling the ConstructEnvsSampler obj's underlying member method code with example usage: obj.n_tasks() and returns: len