(self, fname)
Write file containing array shape information for indexing.
Write file containing array shape information for indexing.
Write file containing array shape information for indexing .
def write_index_dict(self, fname):
    """Write file containing array shape information for indexing."""
    pp = pprint.PrettyPrinter()
    output_string = pp.pformat(dict(self.index_dict))
    indent = codegen_util.Indenter()
    imports = [
        "# pylint: disable=bad-continuation",
        "# pylint: disable=line-too-long",
    ]
    with open(fname, "w") as f:
      f.write(self.make_header(imports))
      f.write("array_sizes = (\n")
      with indent:
        f.write(output_string)
      f.write("\n)")
      f.write("\n" + codegen_util.comment_line("End of generated code"))
def write_index_dict ( self , fname ) : pp = pprint . PrettyPrinter ( ) output_string = pp . pformat ( dict ( self . index_dict ) ) indent = codegen_util . Indenter ( ) imports = [ "# pylint: disable=bad-continuation" , "# pylint: disable=line-too-long" , ] with open ( fname , "w" ) as f : f . write ( self . make_header ( imports ) ) f . write ( "array_sizes = (\n" ) with indent : f . write ( output_string ) f . write ( "\n)" ) f . write ( "\n" + codegen_util . comment_line ( "End of generated code" ) )