Team Ai
Apppublic

xdecoder/Instruct-X-Decoder

sourceHugging Faceafl-3.0updated 3y agoView on Hugging Face
163likes
backbone.cpython-38.pyc39 linesDownload Raw Back to __pycache__
1U

2E$�c��@s4ddlmZddlmZdgZGdd�dej�ZdS)�N)�	ShapeSpec�BackbonecsBeZdZdZ�fdd�Zdd�Zeed�dd��Zd	d3�Z	�Z4S)rz45    Abstract base class for network backbones.6    cst���dS)z]7        The `__init__` method of any subclass can specify its own set of arguments.8        N)�super�__init__��self��	__class__��3/data/arXiv/demo/Demo/xdecoder/backbone/backbone.pyrszBackbone.__init__cCsdS)z�9        Subclasses must override this method, but adhere to the same return type.10 11        Returns:12            dict[str->Tensor]: mapping from feature name (e.g., "res2") to tensor13        Nr14rr15r16r�forwardszBackbone.forward)�returncCsdS)a~17        Some backbones require the input height and width to be divisible by a18        specific integer. This is typically true for encoder / decoder type networks19        with lateral connection (e.g., FPN) for which feature maps need to match20        dimension in the "bottom up" and "top down" paths. Set to 0 if no specific21        input size divisibility is required.22        rr23rr24r25r�size_divisibilitys	zBackbone.size_divisibilitycs�fdd��jD�S)z;26        Returns:27            dict[str->ShapeSpec]28        cs&i|]}|t�j|�j|d��qS))�channels�stride)rZ_out_feature_channelsZ_out_feature_strides)�.0�namerr29r�30<dictcomp>.s��z)Backbone.output_shape.<locals>.<dictcomp>)Z
_out_featuresrr31rr�output_shape(s32�zBackbone.output_shape)�__name__�33__module__�__qualname__�__doc__rr�property�intrr�
__classcell__r34r35rrr	s	36)�torch.nn�nnZdetectron2.modelingr�__all__�Modulerr37r38r39r�<module>s