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

Method dtype

python/paddle/base/framework.py:2469–2489  ·  view source on GitHub ↗

Indicating data type of current Variable **Notes: This is a read-only property** Examples: .. code-block:: pycon >>> import paddle.base as base >>> cur_program = base.Program() >>> cur_block = cur_program.current

(self)

Source from the content-addressed store, hash-verified

2467
2468 @property
2469 def dtype(self):
2470 """
2471 Indicating data type of current Variable
2472
2473 **Notes: This is a read-only property**
2474
2475 Examples:
2476 .. code-block:: pycon
2477
2478 >>> import paddle.base as base
2479 >>> cur_program = base.Program()
2480 >>> cur_block = cur_program.current_block()
2481 >>> new_variable = cur_block.create_var(
2482 ... name="X",
2483 ... shape=[-1, 23, 48],
2484 ... dtype="float32",
2485 ... )
2486 >>> print("Dtype of current Var is: {}".format(new_variable.dtype))
2487 Dtype of current Var is: paddle.float32
2488 """
2489 return self.desc.dtype()
2490
2491 @property
2492 def lod_level(self):

Calls

no outgoing calls

Tested by

no test coverage detected