You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

graph_opt_config.py 844 B

1234567891011121314151617181920212223242526
  1. # -*- coding: utf-8 -*-
  2. class GraphOptimizationConfig:
  3. r"""Configuration for graph optimization: False for OFF, True for ON. The default value
  4. None means that opt_level will decide whther this optimization will be applied or not.
  5. Args:
  6. jit_fuse_dimshuffle: whether to fuse dimshuffle in JIT optimization
  7. jit_fuse_reduce: whether to fuse reduce in JIT optimization
  8. """
  9. def __init__(self):
  10. self.jit_fuse_dimshuffle = None
  11. self.jit_fuse_reduce = None
  12. def __repr__(self):
  13. val2str = {None: "UNSET", False: "OFF", True: "ON"}
  14. return (
  15. "GraphOptimizationConfig {"
  16. + " jit_fuse_dimshuffle = "
  17. + val2str[self.jit_fuse_dimshuffle]
  18. + ", jit_fuse_reduce = "
  19. + val2str[self.jit_fuse_reduce]
  20. + " }"
  21. )