parameters: (t1, t2, out_format=default_mode, dtype=None)
return_statement: return result_tensor
docstring: The dot product of two tensors.
  
      This implements the same spec as numpy but allows for sparse taco tensors as operands.
  
      * If both t1 and t2 are 1-D then this is an inner product.
  
      * If either operand is a scalar, this is equivalent to element-wise multiply.
  
      * Equivalent to matrix multiplication if both tensors are 2-D
  
      * If t1 is N-D and t2 is 1-D,t is a sum product over the last axis of t1 and t2
  
      * if t1 is an N-D array and t2 is an M-D array (where M>=2), it is a sum product over the last axis of t1 and the
        second-to-last axis of t2:
  
  
      We could write this using index expressions for two 3-D tensors as:
      ``T[i, j, k, m] = t1[i, j, l] * t2[k, l, m]``
  
      In the above, T = dot(t1, t2)
  
      Parameters
      ------------
      t1, t2: tensors, array_like
          The arguments to dot. The side of the last dimension of t1 must be equal to the size of the second to last
          dimension of t2.
  
      out_format: format, mode_format, optional
          * If a :class:`format` is specified, the result tensor is stored in the format out_format.
          * If a :class:`mode_format` is specified, the result the result tensor has a with all of the dimensions
            stored in the :class:`mode_format` passed in.
  
      dtype: Datatype
          The datatype of the output tensor.
  
  
      Examples
      ---------
      >>> import pytaco as pt
      >>> pt.dot(3, 4)[0]
      12.0
      >>> a = [[1, 0], [0, 1]]
      >>> b = [[4, 1], [2, 2]]
      >>> pt.dot(a, b).to_array()
      array([[4, 1],
             [2, 2]], dtype=int64)
  
      Returns
      --------
      res: tensor
          The dot product of the input tensors.
docstring_summary: The dot product of two tensors.
docstring_tokens: The dot product of two tensors .
function: def dot(t1, t2, out_format=default_mode, dtype=None):
      """
      The dot product of two tensors.
  
      This implements the same spec as numpy but allows for sparse taco tensors as operands.
  
      * If both t1 and t2 are 1-D then this is an inner product.
  
      * If either operand is a scalar, this is equivalent to element-wise multiply.
  
      * Equivalent to matrix multiplication if both tensors are 2-D
  
      * If t1 is N-D and t2 is 1-D,t is a sum product over the last axis of t1 and t2
  
      * if t1 is an N-D array and t2 is an M-D array (where M>=2), it is a sum product over the last axis of t1 and the
        second-to-last axis of t2:
  
  
      We could write this using index expressions for two 3-D tensors as:
      ``T[i, j, k, m] = t1[i, j, l] * t2[k, l, m]``
  
      In the above, T = dot(t1, t2)
  
      Parameters
      ------------
      t1, t2: tensors, array_like
          The arguments to dot. The side of the last dimension of t1 must be equal to the size of the second to last
          dimension of t2.
  
      out_format: format, mode_format, optional
          * If a :class:`format` is specified, the result tensor is stored in the format out_format.
          * If a :class:`mode_format` is specified, the result the result tensor has a with all of the dimensions
            stored in the :class:`mode_format` passed in.
  
      dtype: Datatype
          The datatype of the output tensor.
  
  
      Examples
      ---------
      >>> import pytaco as pt
      >>> pt.dot(3, 4)[0]
      12.0
      >>> a = [[1, 0], [0, 1]]
      >>> b = [[4, 1], [2, 2]]
      >>> pt.dot(a, b).to_array()
      array([[4, 1],
             [2, 2]], dtype=int64)
  
      Returns
      --------
      res: tensor
          The dot product of the input tensors.
  
  
      """
      t1, t2 = as_tensor(t1, False), as_tensor(t2, False)
      if t1.order == 0 or t2.order <= 1:
          return inner(t1, t2, out_format, dtype)
  
      # Here we know that a is a non-scalar and b has order at least 2
      out_shape = _dot_output_shape(t1.shape, t2.shape)
      out_dtype = _cm.max_type(t1.dtype, t2.dtype) if dtype is None else dtype
  
      t1_vars = _cm.get_index_vars(t1.order - 1)
      t2_vars = _cm.get_index_vars(t2.order - 1)
      res_vars = t1_vars + t2_vars
  
      reduction_var = _cm.index_var()
      t1_vars.append(reduction_var)
      t2_vars = t2_vars[:-1] + [reduction_var] + t2_vars[-1:]
      result_tensor = tensor(out_shape, fmt=out_format, dtype=out_dtype)
      result_tensor[res_vars] = t1[t1_vars] * t2[t2_vars]
      return result_tensor
function_tokens: def dot ( t1 , t2 , out_format = default_mode , dtype = None ) : t1 , t2 = as_tensor ( t1 , False ) , as_tensor ( t2 , False ) if t1 . order == 0 or t2 . order <= 1 : return inner ( t1 , t2 , out_format , dtype ) # Here we know that a is a non-scalar and b has order at least 2 out_shape = _dot_output_shape ( t1 . shape , t2 . shape ) out_dtype = _cm . max_type ( t1 . dtype , t2 . dtype ) if dtype is None else dtype t1_vars = _cm . get_index_vars ( t1 . order - 1 ) t2_vars = _cm . get_index_vars ( t2 . order - 1 ) res_vars = t1_vars + t2_vars reduction_var = _cm . index_var ( ) t1_vars . append ( reduction_var ) t2_vars = t2_vars [ : - 1 ] + [ reduction_var ] + t2_vars [ - 1 : ] result_tensor = tensor ( out_shape , fmt = out_format , dtype = out_dtype ) result_tensor [ res_vars ] = t1 [ t1_vars ] * t2 [ t2_vars ] return result_tensor