class_docstr: Object to store runtime and memory profiling information for all of
  Theano's operations: compilation, optimization, execution.
  
  Parameters
  ----------
  atexit_print : bool
      True means that this object will be printed to stderr (using .summary())
      at the end of the program.
  **kwargs : misc initializers
      These should (but need not) match the names of the class vars declared
      in this class.
class_docstr_tok: ["Object","to","store","runtime","and","memory","profiling","information","for","all","of","Theano","'s","operations",":","compilation",",","optimization",",","execution",".","Parameters","--","--","--","--","--","atexit_print",":","bool","True","means","that","this","object","will","be","printed","to","stderr","(","using",".summary","(",")",")","at","the","end","of","the","program",".","*","*","kwargs",":","misc","initializers","These","should","(","but","need","not",")","match","the","names","of","the","class","vars","declared","in","this","class","."]
code: def print_tips(self, file):
      print(
          """Here are tips to potentially make your code run faster
                   (if you think of new ones, suggest them on the mailing list).
                   Test them first, as they are not guaranteed to always provide a speedup.""",
          file=file,
      )
  
      import theano
  
      RandomFunction = theano.tensor.raw_random.RandomFunction
      scal = theano.scalar
      T = theano.tensor
      scalar_op_amdlibm_no_speed_up = [
          scal.LT,
          scal.GT,
          scal.LE,
          scal.GE,
          scal.EQ,
          scal.NEQ,
          scal.InRange,
          scal.Switch,
          scal.OR,
          scal.XOR,
          scal.AND,
          scal.Invert,
          scal.Maximum,
          scal.Minimum,
          scal.Add,
          scal.Mul,
          scal.Sub,
          scal.TrueDiv,
          scal.IntDiv,
          scal.Clip,
          scal.Second,
          scal.Identity,
          scal.Cast,
          scal.Sgn,
          scal.Neg,
          scal.Inv,
          scal.Sqr,
      ]
      scalar_op_amdlibm_speed_up = [
          scal.Mod,
          scal.Pow,
          scal.Ceil,
          scal.Floor,
          scal.RoundHalfToEven,
          scal.RoundHalfAwayFromZero,
          scal.Log,
          scal.Log2,
          scal.Log10,
          scal.Log1p,
          scal.Exp,
          scal.Sqrt,
          scal.Abs,
          scal.Cos,
          scal.Sin,
          scal.Tan,
          scal.Tanh,
          scal.Cosh,
          scal.Sinh,
          T.nnet.sigm.ScalarSigmoid,
          T.nnet.sigm.ScalarSoftplus,
      ]
  
      def get_scalar_ops(s):
          if isinstance(s, theano.scalar.Composite):
              l = []
              for node in s.fgraph.toposort():
                  l += get_scalar_ops(node.op)
              return l
          else:
              return [s]
  
      def list_scalar_op(op):
          if isinstance(op.scalar_op, theano.scalar.Composite):
              return get_scalar_ops(op.scalar_op)
          else:
              return [op.scalar_op]
  
      def amdlibm_speed_up(op):
          if not isinstance(op, T.Elemwise):
              return False
          else:
              l = list_scalar_op(op)
              for s_op in l:
                  if s_op.__class__ in scalar_op_amdlibm_speed_up:
                      return True
                  elif (
                      s_op.__class__
                      not in scalar_op_amdlibm_no_speed_up
                  ):
                      print(
                          "We don't know if amdlibm will accelerate "
                          "this scalar op.",
                          s_op,
                          file=file,
                      )
              return False
  
      def exp_float32_op(op):
          if not isinstance(op, T.Elemwise):
              return False
          else:
              l = list_scalar_op(op)
              return any([s_op.__class__ in [scal.Exp] for s_op in l])
  
      printed_tip = False
      # tip 1
      if config.floatX == "float64":
          print("  - Try the Theano flag floatX=float32", file=file)
          printed_tip = True
  
      # tip 2
      if not config.lib.amdlibm and any(
          [amdlibm_speed_up(a.op) for a in self.apply_time]
      ):
          print(
              "  - Try installing amdlibm and set the Theano flag "
              "lib.amdlibm=True. This speeds up only some Elemwise "
              "operation.",
              file=file,
          )
          printed_tip = True
  
      # tip 3
      if not config.lib.amdlibm and any(
          [
              exp_float32_op(a.op) and a.inputs[0].dtype == "float32"
              for a in self.apply_time
          ]
      ):
          print(
              "  - With the default gcc libm, exp in float32 is slower "
              "than in float64! Try Theano flag floatX=float64, or "
              "install amdlibm and set the theano flags lib.amdlibm=True",
              file=file,
          )
          printed_tip = True
  
      # tip 4
      for a in self.apply_time:
          node = a
          if isinstance(node.op, T.Dot) and all(
              [len(i.type.broadcastable) == 2 for i in node.inputs]
          ):
              print(
                  "  - You have a dot operation that was not optimized to"
                  " dot22 (which is faster). Make sure the inputs are "
                  "float32 or float64, and are the same for both inputs. "
                  "Currently they are: %s"
                  % [i.type for i in node.inputs],
                  file=file,
              )
              printed_tip = True
  
      # tip 5
      for a in self.apply_time:
          node = a
          if isinstance(node.op, RandomFunction):
              printed_tip = True
              print(
                  "  - Replace the default random number generator by "
                  "'from theano.sandbox.rng_mrg import MRG_RandomStreams "
                  "as RandomStreams', as this is is faster. It is still "
                  "experimental, but seems to work correctly.",
                  file=file,
              )
              if config.device.startswith("gpu"):
                  print(
                      "     - MRG_RandomStreams is the only random number"
                      " generator supported on the GPU.",
                      file=file,
                  )
              break
  
      # tip 6
      for a in self.apply_time:
          node = a
          if (
              isinstance(node.op, T.Dot)
              and len(set(i.dtype for i in node.inputs)) != 1
          ):
              print(
                  "  - You have a dot operation that has different dtype "
                  " for inputs (%s). Make sure that the inputs have same "
                  " dtype." % [i.type for i in node.inputs],
                  file=file,
              )
              printed_tip = True
  
      # tip 7
      from theano.tensor.nnet import LogSoftmax
      import theano.tensor.signal.pool as pool
      import theano.gpuarray
  
      for a in self.apply_time:
          node = a
          if isinstance(node.op, pool.Pool):
              if not theano.gpuarray.dnn.dnn_present():
                  print(
                      "Install CuDNN to do pooling faster"
                      "this allows the operation to run on GPU"
                  )
                  printed_tip = True
          if isinstance(node.op, LogSoftmax):
              if not theano.gpuarray.dnn.dnn_present():
                  print(
                      "Install CuDNN to do LogSoftmax faster"
                      "this allows the operation to run on GPU"
                  )
                  printed_tip = True
  
      if not printed_tip:
          print("  Sorry, no tip for today.", file=file)
  
imports: from __future__ import absolute_import, print_function, division
  import atexit
  import copy
  import logging
  import operator
  import os
  import sys
  import time
  from collections import defaultdict
  from six import iteritems
  import warnings
  import numpy
  import theano
  from theano.gof import graph
label_desc: Use image node_id 20 for calling the ProfileStats obj's underlying member method code with example usage: obj.print_tips(file) and returns: l, list, get_scalar_ops, list, False, False, False, any, True