MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / get_tensor

Function get_tensor

tensorflow/contrib/summary/summary_ops_test.py:396–405  ·  view source on GitHub ↗
(db, tag_id, step)

Source from the content-addressed store, hash-verified

394
395
396def get_tensor(db, tag_id, step):
397 cursor = db.execute(
398 'SELECT dtype, shape, data FROM Tensors WHERE series = ? AND step = ?',
399 (tag_id, step))
400 dtype, shape, data = cursor.fetchone()
401 assert dtype in _NUMPY_NUMERIC_TYPES
402 buf = np.frombuffer(data, dtype=_NUMPY_NUMERIC_TYPES[dtype])
403 if not shape:
404 return buf[0]
405 return buf.reshape([int(i) for i in shape.split(',')])
406
407
408def int64(x):

Callers 1

testIntegerSummariesMethod · 0.85

Calls 3

reshapeMethod · 0.80
executeMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected