parameters: (out_dir)
docstring: Create a SavedModel that performs a small matmul.
docstring_summary: Create a SavedModel that performs a small matmul.
docstring_tokens: Create a SavedModel that performs a small matmul .
function: def create_small_matmul_savedmodel(out_dir):
    """Create a SavedModel that performs a small matmul."""
    root = tracking.AutoTrackable()
    root.f = def_function.function(
        lambda x, y: math_ops.matmul(x, y),  # pylint: disable=unnecessary-lambda
        input_signature=[tensor_spec.TensorSpec([3, 5], dtypes.float32),
                         tensor_spec.TensorSpec([5, 4], dtypes.float32),])
    root.f(x=array_ops.zeros((3, 5)),
           y=array_ops.zeros((5, 4)))
    save_dir = os.path.join(out_dir, 'x_matmul_y_small')
    save.save(root, save_dir, root.f)
    # This simple SavedModel lacks any variables, but we need to create a
    # variables.index file to make bazel genrule happy.
    with open(os.path.join(save_dir, 'variables', 'variables.index'), 'w'):
      pass
function_tokens: def create_small_matmul_savedmodel ( out_dir ) : root = tracking . AutoTrackable ( ) root . f = def_function . function ( lambda x , y : math_ops . matmul ( x , y ) , # pylint: disable=unnecessary-lambda input_signature = [ tensor_spec . TensorSpec ( [ 3 , 5 ] , dtypes . float32 ) , tensor_spec . TensorSpec ( [ 5 , 4 ] , dtypes . float32 ) , ] ) root . f ( x = array_ops . zeros ( ( 3 , 5 ) ) , y = array_ops . zeros ( ( 5 , 4 ) ) ) save_dir = os . path . join ( out_dir , 'x_matmul_y_small' ) save . save ( root , save_dir , root . f ) # This simple SavedModel lacks any variables, but we need to create a # variables.index file to make bazel genrule happy. with open ( os . path . join ( save_dir , 'variables' , 'variables.index' ) , 'w' ) : pass