在 PERFORM 或 CALL FUNCTION "FRM_CREATE_CONTENT" 中,实际参数"GT_ALV2_NEW" 对于形式参数 "LT_ALV_NEW" 而言太短。
时间: 2024-03-11 14:41:38 浏览: 17
根据提供的引用内容,"在 PERFORM CALL FUNCTION "FRM_CREATE_CONTENT" 中,实际参数"GT_ALV2_NEW" 对于形式参数 "LT_ALV_NEW" 而言太短"这句话的意思是在调用名为"FRM_CREATE_CONTENT"的子程序或函数时,实际传递的参数"GT_ALV2_NEW"的长度比形式参数"LT_ALV_NEW"要短。
这可能会导致数据截断或其他错误。为了解决这个问题,你可以检查实际参数"GT_ALV2_NEW"的长度是否满足形式参数"LT_ALV_NEW"的要求,并相应地调整参数的长度。
如果你能提供更多关于"FRM_CREATE_CONTENT"子程序或函数的信息,我可以给出更具体的建议。
相关问题
如何获取到self.perform_create(serializer)后的序列
在 Django Rest Framework 中,`self.perform_create(serializer)` 方法执行后,会创建一个新的对象,并将其保存到数据库中。如果你希望获取保存到数据库中的新对象的序列化数据,可以在调用 `self.perform_create(serializer)` 方法之后,再次对该对象进行序列化。
例如,假设你有一个视图类 `MyView`,其 `perform_create` 方法如下:
```python
class MyView(generics.CreateAPIView):
queryset = MyModel.objects.all()
serializer_class = MySerializer
def perform_create(self, serializer):
instance = serializer.save()
# do something with the new instance
return instance
```
在 `perform_create` 方法中,`serializer.save()` 会创建一个新的对象,并将其保存到数据库中。如果你希望获取该对象的序列化数据,可以在 `perform_create` 方法中添加以下代码:
```python
class MyView(generics.CreateAPIView):
queryset = MyModel.objects.all()
serializer_class = MySerializer
def perform_create(self, serializer):
instance = serializer.save()
# do something with the new instance
serialized_data = self.get_serializer(instance).data
return instance
```
在上面的代码中,`self.get_serializer(instance).data` 会对新创建的对象进行序列化,并返回序列化后的数据。你可以将其保存到变量 `serialized_data` 中,以便后续使用。
dgl.nn.pytorch中edge_softmax的参数
在dgl.nn.pytorch中,edge_softmax函数的参数是边权重张量和图对象。具体来说,函数的定义如下:
```python
def edge_softmax(graph, efeat):
r"""Apply softmax over the edges of a graph.
Description
-----------
Given a graph and its edge features, this function computes the softmax
over the edge features for each destination node. Suppose we have a
graph with :math:`N` nodes, :math:`E` edges and feature size :math:`D`.
If the input edge feature tensor is :math:`(E, D)`, the output tensor
will be of shape :math:`(E, 1)`.
Parameters
----------
graph : DGLGraph
The graph to perform edge softmax.
efeat : torch.Tensor
The input edge feature tensor.
Returns
-------
tensor
Softmax probability tensor with respect to the last dimension of efeat.
Notes
-----
* Input shape: :math:`(E, D)`
* Output shape: :math:`(E, 1)`
"""
```
其中`graph`是DGLGraph对象,表示当前的图,`efeat`是维度为`(E, D)`的张量,其中`E`表示边的数量,`D`表示每条边的特征维度。函数返回的是一个维度为`(E, 1)`的张量,表示每条边的softmax概率。