noalias_dumper.ignore_aliases = lambda self, data: True
# Support serializing OrderedDict
noalias_dumper.add_representer(OrderedDict, dict_representer)
- return yaml.dump(data, default_flow_style=False, Dumper=noalias_dumper)
+ # Some yaml parsers (e.g. Haskell's) don't understand line breaks.
+ # width=float('Inf') turns off optional line breaks and improves
+ # the portability of the outputted yaml.
+ return yaml.dump(data, default_flow_style=False, Dumper=noalias_dumper, width=float('Inf'))
def generate_storage_type_and_tensor(backend, density, scalar_type, declarations):