o

    xoh                     @   s4   d dl Z d dlm  mZ d dlmZ dddZdS )    N)	SobelConv      ?c                 C   sJ   |j d dkr|jddd}t |j}||}|| }|t|| S )N   T)dimkeepdim)shapemeanr   todeviceFl1_loss)	attn_maskZ	input_imgweightZsobelZ
edge_inputZ	edge_attn r   =/root/Awesome-Backbones/configs/losses/gray_attention_loss.py	SobelLoss   s   r   )r   )torchtorch.nn.functionalnn
functionalr   Z&core.modules.structural_gray_attentionr   r   r   r   r   r   <module>   s    