관리-도구
편집 파일: einsumfunc.cpython-311.pyc
� �܋f�� � � � d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddgZ dZ ee� � Z d � Zd � Zd� Zd� Zd � Zd� Zd� Zd� Zd� Zddd�d�Z e ed�� � ddd�d�� � Zddd�d�Z e ed�� � ddd�d�� � ZdS )z& Implementation of optimized einsum. � N)�c_einsum)� asanyarray� tensordot)�array_function_dispatch�einsum�einsum_path�4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZc �` � t | |� � }t d|dz � � }|r|dz }||z S )a� Computes the number of FLOPS in the contraction. Parameters ---------- idx_contraction : iterable The indices involved in the contraction inner : bool Does this contraction require an inner product? num_terms : int The number of terms in a contraction size_dictionary : dict The size of each of the indices in idx_contraction Returns ------- flop_count : int The total number of FLOPS required for the contraction. Examples -------- >>> _flop_count('abc', False, 1, {'a': 2, 'b':3, 'c':5}) 30 >>> _flop_count('abc', True, 2, {'a': 2, 'b':3, 'c':5}) 60 � )�_compute_size_by_dict�max)�idx_contraction�inner� num_terms�size_dictionary�overall_size� op_factors �L/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/core/einsumfunc.py�_flop_countr sB � �>