1. Check the input arrays of general dot have the same number of batch    dimensions as each other and have the same number of contraction    dimensions as each other; 2. Remove unncessary if statement in `dot_general`; 3. Remove unncessary loop in the helper `_compose_output_rep`; 4. Improve the docstring of general dot and its helper according to the    format of other functions in extensions.
1. Check the input arrays of general dot have the same number of batch
   dimensions as each other and have the same number of contraction
   dimensions as each other;
2. Remove unncessary if statement in `dot_general`;
3. Remove unncessary loop in the helper `_compose_output_rep`;
4. Improve the docstring of general dot and its helper according to the
   format of other functions in extensions.

google/trax,google/trax