MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / replace_ndarray_and_range

Function replace_ndarray_and_range

python/paddle/base/variable_index.py:63–72  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

61
62
63def replace_ndarray_and_range(item):
64 new_item = []
65 for slice_item in item:
66 if isinstance(slice_item, np.ndarray):
67 new_item.append(paddle.assign(slice_item))
68 elif isinstance(slice_item, range):
69 new_item.append(list(slice_item))
70 else:
71 new_item.append(slice_item)
72 return new_item
73
74
75def replace_none(item):

Callers 1

parse_indexFunction · 0.85

Calls 3

listFunction · 0.85
appendMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected