Closed HenryBao91 closed 2 years ago
请给出复现步骤。
我在python 3.8.13、torch 1.11.0下运行run_din.py(使用了SequencePoolingLayer),没有复现出这个报错 1、run_din.py可以正常跑通
2、uiseq_embed_list的类型为torch.Tensor,有shape属性,不会报错
你是运行哪个文件报错的?请给出复现步骤
To Reproduce(复现步骤) Steps to reproduce the behavior:
Describe the question(问题描述)
AttributeError: 'Embedding' object has no attribute 'shape'
.Additional context
https://github.com/shenweichen/DeepCTR-Torch/blob/master/deepctr_torch/layers/sequence.py
. 代码 57 行和 67 行, uiseq_embed_list 变量的类型为 torch.nn.modules.sparse.Embedding ,uiseq_embed_list 没有 shape 方法, uiseq_embed_list.shape[1] 和 uiseq_embed_list.shape[-1] 报错Operating environment(运行环境):